Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error message produced for missing content-type is weird #114

Closed
henhal opened this issue Nov 8, 2019 · 2 comments
Closed

Error message produced for missing content-type is weird #114

henhal opened this issue Nov 8, 2019 · 2 comments

Comments

@henhal
Copy link

henhal commented Nov 8, 2019

If a path requires a request body of type application/json but the request has no Content-Type header set, express-openapi-validator will produce the following error:

415 - unsupported media type not_provided

This is hard to understand - not_provided seems to be used as an internal constant for missing Content-Type but this should perhaps not be returned outside of the module? A better error message would be:

415 - media type not specified

cdimascio added a commit that referenced this issue Nov 9, 2019
(fix) Error message unspecified content-type #114
@cdimascio
Copy link
Owner

@henhal thanks for the issue. the message is fixed in 2.14..4

@ghost
Copy link

ghost commented Dec 15, 2021

I got this message also when I posted to my API without a body, on accident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants