swagger-codegen icon indicating copy to clipboard operation
swagger-codegen copied to clipboard

Generating Docs by Method Instead of by Tag

Open PeaceInColour opened this issue 8 years ago • 0 comments

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.

PeaceInColour avatar Apr 13 '18 21:04 PeaceInColour