Is it possible to document headers for multiple responses in OpenAPI? #4744
Replies: 1 comment
|
You're not doing anything wrong. What I've fallen back to. For tighter control of per-status headers in the generated OpenAPI spec, you can post-process the schema with an Worth filing as a feature request if there isn't one already. OpenAPI 3.x supports headers per response object natively, and the shape you sketched ( |
Uh oh!
There was an error while loading. Please reload this page.
I am writing a
putendpoint, where if the resource does not exist, a resource will be created with201, otherwise it will be updated with200. I also want to addetagandLocationheaders:I tried the following:
This does not work, the generated documentation for responses does not contain headers section. Even if it had worked, I would have preferred something like this:
which is currently an error, as
ResponseSpecdoes not take aheadersargument.Am I doing something wrong? Or is it not possible?
All reactions