OpenAPI in function docstring? - YAML verbatim vs JavaDoc #2460
Replies: 2 comments 2 replies
-
I've converted this issue to a discussion item, as it doesn't represent an issue or idea for the specification itself. Hopefully members of the community with experience of code annotations will add their thoughts here. |
Beta Was this translation helpful? Give feedback.
-
@SamuelMarks with apologies for the back-and-forth (we're kind of coming out of pandemic-era hibernation, and no one currently active seems to recall what the plan was for discussions vs issues), I'm going to close this in favor of issue #1740 which tracks the specification aspects. But I also encourage looking at the OAS 4 "Moonwalk" discussions which are in their own repo. As for the "what should I do with docstrings" part, that's outside of the scope of the specification, and our set of active volunteers isn't large enough to curate non-specification discussions. You might find some fellow implementors on our Slack. More people monitor that than monitor these discussions. |
Beta Was this translation helpful? Give feedback.
-
Writing bidirectional code-generators for a number of languages, that take the language and generate Swagger/OpenAPI, and take Swagger/OpenAPI and update—or insert—the target language.
My question is what to put in the docstring, for example this pseudocode route:
What should the docstring say? - I've seen some approaches which just put YAML verbatim inside, like:
But that seems rather nonstandard for maintainers. They need to think about the OpenAPI specification rather than JavaDoc (or whatever docstring format their language recommends).
Is there a compromise, a way of specifying inside the docstring? - Or would you suggest just to use your YAML?
Beta Was this translation helpful? Give feedback.
All reactions