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

Nested tagging

Open daltonconley opened this issue 1 year ago • 2 comments

Is your feature request related to a problem?

I'm looking to auto-generate sub categories for my APIs when using the groupPathsBy feature.

Describe the solution you'd like

I would like to be able to some how build out sub categories based on tags. I don't think anything like this is really supported in the openapi spec, but the spec does allow for multiple tags. Perhaps the plugin could parse each tag as an additional sub category? The downside to this could be large trees of tags for people who use many tags for their endpoints. Perhaps the plugin could parse something with slashes or dots. In this scenario, something like tags: ["Tag1", "Tag1.Tag2"] would generate the following:

Tag1
  - Tag 2
    - [verb] Operation

Describe alternatives you've considered

I've created a sidebar manually, but in the future, when there could be potentially 100's of endpoints, this will be difficult.

Additional context

One thing to note on the example above is, I'm using swagger-codegen to create my openapi specs. In Java, this lets me create tags at the "controller" level which get propagated down to the individual endpoint level. That is why you see Tag1 and then Tag1.Tag2 above.

daltonconley avatar Aug 29 '22 22:08 daltonconley

:tada: Thanks for opening your first issue here! Welcome to the community!

Hi @daltonconley, thanks for the feature request!

Nested tags or tag groups is something we've explored as a way to help with generating sidebars. That said, we ran into some technical concerns/limitations we'd have to overcome when dealing with multi-spec (i.e. reading in and processing multiple OpenAPI specs from a directory). The basic problem to solve for is coming up with a way/convention to reconcile how tags should be treated/handled across multiple specs. See #140 for more context.

Happy to continue the discussion here.

sserrata avatar Aug 30 '22 19:08 sserrata