Given payload validation is turned on for incoming requests and a requestBody defining content of application/json in the openapi spec
When a request is made with a Content-Type of application/json; charset=utf-8
Expectation:
Then the request is validated against the defined application/json content spec
Actual:
Then the request is not validated
This appears to be due to the request's content-type being used as a key for getting the appropriate media from the Content Map at:
|
io.swagger.v3.oas.models.media.MediaType media = content.get(mediaType.toString()); |
In this scenario, mediaType will be equal to application/json;charset=UTF-8 but content only has a mapping for application/json, thus media becomes null and validation is subsequently skipped.
Using swagger-inflector:2.0.8