PaloAltoNetworks / PaloAltoNetworks/docusaurus-openapi-docs

[FR] API doc version context switcher

Open
#128 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
TypeScript
Stars
1.1k
Forks
315
Avg merge
7d 5h
Merged PRs (30d)
7

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ApiDemoPanel and the existing version dropdown and sidebar version badge in the API documentation UI. Read how API version metadata is represented, then define the supported-version lookup and placement of the context switcher; done means the current version is active and only versions supporting the endpoint are shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
openapi, react, typescript
Domain
documentation, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.