swagger-api / swagger-api/swagger-codegen
Generating Docs by Method Instead of by Tag
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Currently documentation in the docs folder for various languages is grouped by tags (ie. there will be a documentation file for each tag). These files will contain the generated documentation for each method in the tag. Typically the documentation includes multiple sections such as: examples, parameters, return types, authortization, and request headers.
While this is all really useful it would be more convenient in my situation to have the documentation split into individual files for each method with only the code example being generated. This is because I want to use ReDoc to display my documentation from an OpenAPI file. ReDoc has vendor extensions which allow for adding examples in multiple languages to endpoint documentation (similar to HTML2). Ideally, I'd generate the examples with Codegen for each language, then add the examples to my OpenAPI file with ReDoc's vendor extensions.
I was wondering if anyone else wants this feature? I don't mind implementing it since the changes required seem pretty straightforward. The documentation could be generated in both formats or there could be a config setting for choosing how to generated the docs with the current implementation as the default for when nothing is selected.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The docs folder currently groups generated documentation by tags; start by tracing that generation path and its existing configuration. Compare the output with the OpenAPI and ReDoc use case, then define method-level files containing only code examples while preserving the current format by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- openapi
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100