Skip to content

Fix tagGroup display when showSchemas is configured - #851

Merged
sserrata merged 4 commits into
PaloAltoNetworks:mainfrom
ElliotFriend:836-fix-taggroup-schemas
Jun 27, 2024
Merged

sserrata merged 4 commits into
PaloAltoNetworks:mainfrom
ElliotFriend:836-fix-taggroup-schemas

Conversation

@ElliotFriend

Copy link
Copy Markdown
Contributor

Description

The groupByTags() function in sidebars/index.ts is already generating the Schemas category for both groupBy: "tag" and groupBy: "tagGroup". It seems like the simplest, least disruptive way of accomplishing what I wanted was to utilize the Schemas category after groupByTags() was finished going through all the tagGroups.

In the case of tagGroups, now, it moves the "Schemas" category (if any) from the first tagGroup category (since all the schema categories are identical anyway) to the end of the sidebar, as a "sibling" to all the tagGroup categories. Then, it discards the "Schemas" category from all of the tagGroup categories.

Motivation and Context

As reported in #836, an extra Schemas category is currently placed inside ever tagGroup category if showSchemas: true is configured. This PR aims resolve this.

How Has This Been Tested?

Visibly in this PR, I've added a schema object to the Restaurant example API, and configured it with showSchemas: true. Additionally, I have (locally) tested this out with the tagGrouped API spec that I initially noticed the bug with.

Screenshots (if appropriate)

Screenshot 2024-06-26 at 4 06 31 PM

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate. I couldn't quite figure out where to place a relevant test. None of the existing ones looked like they were applicable to this kind of fix.
  • All new and existing tests passed.

This commit takes the first tagGroup category's Schema category,
adds it to the very end of the sidebarSlice, and deletes the Schema
category from all the (now sibling) tagGroup categories.

Closes PaloAltoNetworks#836
@github-actions

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 776ae5a):

https://docusaurus-openapi-36b86--pr851-ai56f1p1.web.app

(expires Sat, 27 Jul 2024 15:16:48 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sserrata
sserrata merged commit 0730c36 into PaloAltoNetworks:main Jun 27, 2024

This branch was previously deployed

1 inactive deployment
default — 776ae5aa Deployed Jun 26, 2024 by ElliotFriend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants