docusaurus-openapi-docs icon indicating copy to clipboard operation
docusaurus-openapi-docs copied to clipboard

[FR] Improve multi/micro-spec support

Open sserrata opened this issue 3 years ago • 1 comments

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.js slices for each API
  • Introduce groupPathsBy: 'file' to sidebarOptions

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 autogenerated and __category__.json
  • If generating a single sidebar.js for 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-cased info.title?
  • Micro-specs are different, since they represent a single, logical API. For those, we'd ideally just group by 'tag'

sserrata avatar Jun 27 '22 19:06 sserrata

@csestito Feel free to use this issue to track your progress. Thanks!

sserrata avatar Jul 12 '22 19:07 sserrata

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.

csestito avatar Oct 12 '22 17:10 csestito