openapi-request-validator throws error without errorCode
When sending xml instead of json in the body of a POST, I'd expect a media-type error to be returned from the request validator. For some reason, though, it throws an error with an undefined errorCode.
More specifically, this is happening when I make a POST with the header Content-Type: application/xml and the body <test>hello</test>
I'm wondering if this is because of mediaTypeError being treated differently here: https://github.com/kogosoftwarellc/open-api/blob/master/packages/openapi-request-validator/index.ts#L305
i'm not sure we have xml being serialized to json yet. you'd have to add support for this.
@jsdevel I think the point here is the inconsistency in error reporting. All errors raised by openapi-request-validator do specify errorCode except for mediaTypeError and schemaError which don't.
please open a PR