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
{
"message":"/response/data must be object",
"errors":[
{
"path":"/response/data",
"message":"must be object",
"errorCode":"type.openapi.validation"
}
]
}
Describe the bug
express-openapi-validator expects json API responses to be under a
response
object, where the OpenAPI spec doesn't.To Reproduce
OpenAPI spec:
express config:
handler:
Actual behavior
I get this error:
Expected behavior
I would expect my data, conform to the OpenAPI spec, to be returned, without expecting an additional
response
wrapping the OpenAPI spec.See the added
response
here: https://github.com/cdimascio/express-openapi-validator/blame/5c98d17c470aecf53f60d3fb3bda4005d65aa9aa/src/middlewares/openapi.response.validator.ts#L281When I replace this line with:
I get the expected behaviour out of express-openapi-validator
I must be doing something unexpected as I could not find any similar experience, if that's the case, I would appreciate some guidelines 🙏
The text was updated successfully, but these errors were encountered: