Documenting return properties in openapi3 emitter #3074
-
I could just be doing something wrong here, which is why I don't want to file a bug yet, but I'm having trouble understanding how to replicate my existing openapi spec, where I document individual return codes. Here's what I've tried so far:
With this, I end up with:
The original spec that I am trying to more or less end up with is this:
Anyways, I very well could be missing something here about how to properly add return value docs, any help would be appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I do think we cannot do that today inline as you want, you have 2 options:
|
Beta Was this translation helpful? Give feedback.
-
Aha, option 1 works for me, so I'll do that. Though I think it would still be good to have a way to do this with the adhoc return types too.
This syntax seems intuitive to me, but perhaps you have better ideas. |
Beta Was this translation helpful? Give feedback.
I do think we cannot do that today inline as you want, you have 2 options:
@returns
/@errors
doc comment tags(or@returnsDoc
,@errorsDoc
decorators) to specify the doc for success and error cases. However those will be providing the doc for all success and all errors respectively so if you want more granular doc you'll have to go with option 1Playground Example