docusaurus-openapi-docs
docusaurus-openapi-docs copied to clipboard
[FR] Improve multi/micro-spec support
Is your feature request related to a problem?
Currently, docs produced from multiple specs are written to the same directory and directory level. This presents issue when organizing and/or constructing sidebars for different APIs.
Describe the solution you'd like
An organization strategy for handling multi-specs. For example:
- Group and write MDX files to a subdirectory named after kebab-cased
info.title - Continue to write all MDX files to same directory but generate unique
*.sidebar.jsslices for each API - Introduce
groupPathsBy: 'file'tosidebarOptions
Describe alternatives you've considered
Manually constructing the sidebar object can be a painful experience for medium to large APIs.
Additional context
- We should maintain cross-compatibility with Docusaurus sidebars features like
autogeneratedand__category__.json - If generating a single
sidebar.jsfor multiple APIs, each API should be grouped by category label. We would need to decide what label to use or where to derive it from, e.g. kebab-casedinfo.title? - Micro-specs are different, since they represent a single, logical API. For those, we'd ideally just group by 'tag'
@csestito Feel free to use this issue to track your progress. Thanks!
After diving into this, it was decided that this isn't a necessary feature and encourages bad practices in authoring.
Rather than using a spec file for each micro service, we should have one spec file and use appropriate tagging.