Skip to content

Commit

Permalink
openapi3filter: register decoder for other JSON content types (#1026)
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverli authored Nov 3, 2024
1 parent 4d76e26 commit c41a068
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions openapi3filter/req_resp_decoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -1264,6 +1264,9 @@ func decodeBody(body io.Reader, header http.Header, schema *openapi3.SchemaRef,
func init() {
RegisterBodyDecoder("application/json", JSONBodyDecoder)
RegisterBodyDecoder("application/json-patch+json", JSONBodyDecoder)
RegisterBodyDecoder("application/ld+json", JSONBodyDecoder)
RegisterBodyDecoder("application/hal+json", JSONBodyDecoder)
RegisterBodyDecoder("application/vnd.api+json", JSONBodyDecoder)
RegisterBodyDecoder("application/octet-stream", FileBodyDecoder)
RegisterBodyDecoder("application/problem+json", JSONBodyDecoder)
RegisterBodyDecoder("application/x-www-form-urlencoded", urlencodedBodyDecoder)
Expand Down

0 comments on commit c41a068

Please sign in to comment.