fastify / fastify-swagger

Swagger documentation generator for Fastify
MIT License
941 stars 209 forks source link

how to add headers in response body? #697

Closed gusparr28 closed 1 year ago

gusparr28 commented 1 year ago

Prerequisites

Issue

No response

gusparr28 commented 1 year ago

I have an endpoint that doesn't response with JSON, instead it responses with some headers and with file bytes in response body. I would like to add that spec to my Swagger docs, but haven't found a clear solution. Appreciated. Thanks

Uzlopak commented 1 year ago

https://swagger.io/docs/specification/describing-responses/

Read the part regarding response headers.

climba03003 commented 1 year ago

I don't know how you check the document, but it do have a section on response headers. https://github.com/fastify/fastify-swagger#response-headers

Please provide a minimal reproducible code if that doesn't work.