-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Content-type for RequestBody is forced to application/json even when explicitly says in requestBody to use multipart/form-data #677
Comments
You need to use |
Hi @climba03003 Thanks for this. But for our usecase, we can't use static mode because the specification becomes too unwieldy if we put everything inside it (Thus, we opted to use Static mode only accepts Tried it though on the simple setup that I made and it worked though. Although in relation to I think #667 , it becomes just a raw string input instead of a file upload feature. Nevertheless, I am just curious as to why paths are being overrided by What I can say though that the logic is not hampered, unless I put |
Your case is not related to #667.
By combining the above two situation, it is obvious your routes created |
I see. But there is no |
Prerequisites
Fastify version
4.7.0
Plugin version
7.6.1
Node.js version
16.17.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
5.15.0-47-generic
Description
When writing an OpenAPI 3.0.0 specification of a request body content on a path, it forces the content-type to
application/json
even if it is set tomultipart/form-data
.specification
Steps to Reproduce
npm i
npm start
http://localhost:8080/docs
multipart/form-data
and only showsapplication/json
even if it is not part of thesrc/specification.js
Expected Behavior
Expected is that the Request Body is not
application/json
on the documentations page butmultipart/form-data
with the corresponding inputs (like file upload)The text was updated successfully, but these errors were encountered: