You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
The text was updated successfully, but these errors were encountered:
Given payload validation is turned on for incoming requests and a
requestBody
definingcontent
ofapplication/json
in the openapi specWhen a request is made with a
Content-Type
ofapplication/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:
swagger-inflector/src/main/java/io/swagger/oas/inflector/controllers/OpenAPIOperationController.java
Line 353 in afdbac6
In this scenario,
mediaType
will be equal toapplication/json;charset=UTF-8
butcontent
only has a mapping forapplication/json
, thusmedia
becomesnull
and validation is subsequently skipped.Using swagger-inflector:2.0.8
The text was updated successfully, but these errors were encountered: