Skip to content

Commit

Permalink
following up on #544: do not pass through on unhandled case (#550)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp committed May 30, 2022
1 parent 7f8f768 commit 221a292
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
6 changes: 1 addition & 5 deletions openapi3filter/req_resp_encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,5 @@ func encodeBody(body interface{}, mediaType string) ([]byte, error) {
type bodyEncoder func(body interface{}) ([]byte, error)

var bodyEncoders = map[string]bodyEncoder{
"application/json": jsonBodyEncoder,
}

func jsonBodyEncoder(body interface{}) ([]byte, error) {
return json.Marshal(body)
"application/json": json.Marshal,
}
3 changes: 1 addition & 2 deletions openapi3filter/validate_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,7 @@ func ValidateParameter(ctx context.Context, input *RequestValidationInput, param
value = schema.Default
req := input.Request
switch parameter.In {
case openapi3.ParameterInPath:
// TODO: no idea how to handle this
// case openapi3.ParameterInPath: TODO: no idea how to handle this
case openapi3.ParameterInQuery:
q := req.URL.Query()
q.Add(parameter.Name, fmt.Sprintf("%v", value))
Expand Down

0 comments on commit 221a292

Please sign in to comment.