Skip to content

feat: implement x-tagGroup feature#737

Merged
sserrata merged 9 commits intoPaloAltoNetworks:mainfrom
bencagri:feature/x-taggroups
Mar 15, 2024
Merged

feat: implement x-tagGroup feature#737
sserrata merged 9 commits intoPaloAltoNetworks:mainfrom
bencagri:feature/x-taggroups

Conversation

@bencagri
Copy link
Contributor

@bencagri bencagri commented Mar 12, 2024

Description

Docusaurus should support nested sidebar which already implemented in ReDocly as x-tagGroups.

Motivation and Context

Most of the complex Apis need nested resources in one openapi spec. This feature aims to solve this problem within one resource instead of having multiple openapi resources.

How Has This Been Tested?

jest tests added for valid openapi files.

Screenshots (if appropriate)

tags:
  - name: tag1
    description: Everything about your restaurant
    x-displayName: Tag 1
  - name: tag2
    description: Tag 2 description
    x-displayName: Tag 2
  - name: tag3
    description: Tag 3 description
    x-displayName: Tag 3

x-tagGroups:
  - name: Tag 1 & 2
    tags:
      - tag1
      - tag2
  - name: Trinity
    tags:
      - tag1
      - tag2
      - tag3
  - name: Last Two
    tags:
      - tag2
      - tag3
Screenshot 2024-03-12 at 14 46 02

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes if appropriate.
  • All new and existing tests passed.

@bencagri bencagri changed the title impement x-tagGroup feature feat: impement x-tagGroup feature Mar 12, 2024
@bencagri bencagri changed the title feat: impement x-tagGroup feature feat: implement x-tagGroup feature Mar 12, 2024
@github-actions
Copy link

github-actions bot commented Mar 12, 2024

Visit the preview URL for this PR (updated for commit 54399a2):

https://docusaurus-openapi-36b86--pr737-q2pj4lr5.web.app

(expires Thu, 11 Apr 2024 14:46:57 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@sserrata
Copy link
Member

Hi @bencagri, looks like there are a few linter errors and some new merge conflicts. Let me know if I can assist with resolving these issues, thanks!

@bencagri
Copy link
Contributor Author

hi @sserrata, conflicts were resolved and also linter errors fixed.

@sserrata
Copy link
Member

@bencagri, any plans/thoughts on supporting generated category index pages, similar to how non-x-tag-groups are handled?

@bencagri
Copy link
Contributor Author

@bencagri, any plans/thoughts on supporting generated category index pages, similar to how non-x-tag-groups are handled?

hi Steven, actually this should be document writer's choice -from my point of view-. The generator should act as proof of concept, not to generate the docs that are not given.

if you think this is a must, then to provide such a feature, we might generate docs under something uncategorized even if category has not been configured.

But again, this wouldn't be a part of its job. What is your thought?

@sserrata
Copy link
Member

Makes sense to me. I was speaking more about the tag groups that are generated, i.e. whether or not you think they should link to index pages when they are clicked.

@bencagri
Copy link
Contributor Author

hmm. i missed this point. correct, i dont think we should provide index pages, as they are already a category, no?

@sserrata
Copy link
Member

Sorry, it took me a minute to remember the name of the option: categoryLinkSource

docs: https://docusaurus-openapi.tryingpan.dev/#sidebaroptions

reference:

if (taggedInfoObject !== undefined && categoryLinkSource === "info") {

@bencagri
Copy link
Contributor Author

hi @sserrata, i think we should point that categoryLinkSource is disregardred if the groupPathsBy is set as tagGroup

@sserrata sserrata merged commit 5b1cdae into PaloAltoNetworks:main Mar 15, 2024
sserrata pushed a commit that referenced this pull request Mar 15, 2024
* impement redoc's x-tagGroup feature

* merge main

* update documentation

* fix filtered tags by group

* remove tracked .idea files

* add  option to readme

* merge main

* fix lint

* revert yarn.lock and linter
sserrata added a commit that referenced this pull request Mar 15, 2024
* feat: implement  x-tagGroup feature (#737)

* impement redoc's x-tagGroup feature

* merge main

* update documentation

* fix filtered tags by group

* remove tracked .idea files

* add  option to readme

* merge main

* fix lint

* revert yarn.lock and linter

* cleanup missing types, dup imports and add restaurant example

* fix: Guard only undefined and empty strings (#725)

* Conditional display of header Request (#719)

Co-authored-by: Christian A. Mathiesen <christian@zaveit.no>

* update lock file

* feat: Implement schema pages behind a config option `showSchemas` (#736)

* feat: Implement schema pages behind a config option `showSchemas`

* Add `showSchemas` to petstore demo

* address linter errors

* enable schemas for petstore

* update lock file

* add missing heading import

* address linter errors

---------

Co-authored-by: Çağrı S <bencagri@users.noreply.github.com>
Co-authored-by: Florian Garcia <garcia.florian.perso@gmail.com>
Co-authored-by: chranmat <cam@mathix.net>
Co-authored-by: Christian A. Mathiesen <christian@zaveit.no>
Co-authored-by: Marc L <littlemarc2020@gmail.com>
@sserrata sserrata mentioned this pull request Apr 2, 2024
@Muneer-Shafi
Copy link

Muneer-Shafi commented Sep 6, 2024

@sserrata it shows introduction in every dropdown/tagGroup and contains same info please have a look
image

the become active all when clicking on any one

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.

3 participants