You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I believe the solution is to insert some code between lines 92 and 93. This inserted code should switch on the value of s.Value.Schema.Value.Type and convert the string accordingly.
The code to validate the headers in an HTTP response will always fail if the header's data type is anything other than string.
The code at https://github.com/getkin/kin-openapi/blob/v0.110.0/openapi3filter/validate_response.go#L92 gets the value for a given header. The header's value, by the nature of http, is a string. This string is then passed to the
VisitJSON
method at https://github.com/getkin/kin-openapi/blob/v0.110.0/openapi3/schema.go#L810. TheVisitJSON
method expects the value that is passed in to have already been converted into the appropriate Go type. Because the value hasn't been converted theVisitJSON
method will return an error for any header that is supposed to be an integer, number, boolean, or array.I believe the solution is to insert some code between lines 92 and 93. This inserted code should switch on the value of
s.Value.Schema.Value.Type
and convert the string accordingly.It looks like the function
decaodeValue
at https://github.com/getkin/kin-openapi/blob/v0.110.0/openapi3filter/req_resp_decoder.go#L259 might do the kind conversion that is neededThe text was updated successfully, but these errors were encountered: