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

[FR] API doc version context switcher

Open sserrata opened this issue 3 years ago • 1 comments

Is your feature request related to a problem?

When implementing versioning, it's easy for a user to forget or overlook which version of an API doc they are looking at. The existing versioning system provides a version dropdown selector but individual API docs lack the context necessary to label what API version it applies to.

Describe the solution you'd like

An API doc "version context switcher" component that can be used to:

  • Easily identify the current version you are looking at
  • Display and allow the user to easily switch the context to other APIs doc versions the endpoint is supported in

Example:

Screen Shot 2022-06-10 at 2 58 16 PM

A component like the one above could possibly fit in the upper-right of each API doc item, above the ApiDemoPanel section. Preferable using the built-in Infima Tabs or Button components.

The current version should be in the active state. The other versions should only be displayed if the endpoint is actually supported in those versions. The latter will likely require an extended API versions metadata object/file to allow for quick lookup and conditional rendering of supported versions.

Describe alternatives you've considered

Not worrying about it. We already have a dropdown selector and version badge in the sidebar.

Additional context

Will share third-party examples of this use case if I find any!

sserrata avatar Jun 10 '22 20:06 sserrata

I've been trying to think of a good way to handle versioning for our API, which is versioned per resource, not as a whole. The global version dropdown does not seem to be a good fit, whereas this kind of picker might be more suited.

IanVS avatar Feb 08 '23 15:02 IanVS