From c2b77b1b36c7a6d8c608f69e6b9fcc75b87348ea Mon Sep 17 00:00:00 2001 From: Oliver Li Date: Tue, 29 Oct 2024 14:58:48 -0400 Subject: [PATCH] Register decoder for other JSON content types --- openapi3filter/req_resp_decoder.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openapi3filter/req_resp_decoder.go b/openapi3filter/req_resp_decoder.go index e151c9ee..19e3609c 100644 --- a/openapi3filter/req_resp_decoder.go +++ b/openapi3filter/req_resp_decoder.go @@ -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)