Closed daniel-eichinger-bl closed 5 months ago
Since openapi3filter.RegisterBodyDecoder is exported you should be able to workaround this issue by registering the openapi3filter.JSONBodyDecoder in your code. E.g., openapi3filter.RegisterBodyDecoder("application/merge-patch+json“, openapi3filter.JSONBodyDecoder)
.
Closing therefore!
I'm unable to use oapi-codegen/nethttp-middleware for
application/merge-patch+json
Content-Types. I generated a strict server using: https://github.com/deepmap/oapi-codegen and used your middleware to validate requests.The request cannot be validated as https://github.com/oapi-codegen/nethttp-middleware/blob/main/oapi_validate.go#L91 returns an error as the https://github.com/getkin/kin-openapi does not provide a decoder for
application/merge-patch+json
.The maintainers of getkin-openapi made the JSON body decode public (https://github.com/getkin/kin-openapi/pull/896) so it should be possible to register new media types.