Closed davitykale closed 2 years ago
It depends what you want to achieve.
If you want your endpoint to return non application/json
, you can use the $raw
keyword as stated in the README. You can see an example of its usage here https://github.com/ShogunPanda/fastify-openapi-docs/blob/eed33e99c7331b2cf729377e89bfc5ebdfc9ee50/test/spec.test.ts#L492.
With that approach the endpoint will accept that MIME but you will lose the possibility to validate the data.
Or am I missing anything?
@ShogunPanda does this work for the request as well? I want to to make a request to an endpoint with Content-Type: multipart/form-data
and then have the response be JSON
Released in v2.1.0
Amazing! Thank you!
I might be missing something, but it looks like
application/json
is hard-coded as the Content-Type for every endpoint. Is it possible to allow for customizing this?