PaloAltoNetworks / docusaurus-openapi-docs

🦝 OpenAPI plugin for generating API reference docs in Docusaurus v2.
https://docusaurus-openapi.tryingpan.dev
MIT License
561 stars 193 forks source link

Issue when using tag groups #792

Open Kkundan opened 2 months ago

Kkundan commented 2 months ago

Describe the bug

I have used tagGroup to group paths in the side bar. However instead of grouping specific paths, it is grouping all paths in every group.

[ "docusaurus-plugin-openapi-docs", { id: "openapi", docsPluginId: "classic", config: { saviynt:{ specPath: "static/api-specs/saviynt-eic-api-5.0.yaml", outputDir: "docs/eic/", sidebarOptions: { groupPathsBy: "tagGroup", // categoryLinkSource: "tag", }, version: "5.0.0", // Current version label: "v5.0.0", // Current version label baseUrl: "/developer-portal/eic/rest/5.0", // Leading slash is important versions: { "2.0.0": { specPath: "static/api-specs/saviynt-eic-api-2.0.yaml", outputDir: "docs/eic/2.0", // No trailing slash label: "v2.0.0", baseUrl: "/developer-portal/eic/rest/2.0", // Leading slash is important }, }, } satisfies OpenApiPlugin.Options, } satisfies Plugin.PluginOptions, }, ], ],

Expected behavior

I should only group specific path listed under the tagGroup

Current behavior

It is grouping all paths

Possible solution

Steps to reproduce

Screenshots

image

sserrata commented 1 month ago

@bencagri, any idea why this might be occurring?

bencagri commented 1 month ago

hi @Kkundan , have you tried to rebuild the docs with clean-api and gen-api commands?

Kkundan commented 1 month ago

Hi @bencagri : I have tried yarn docusaurus clean-api-docs all and yarn docusaurus clean-api-docs:version saviynt:all. I have also tried manually deleting doc folder contents

bencagri commented 1 month ago

this is weird, i reproduced with the given file aviynt-eic-api-5.0.yaml. here how it looks on my local.

Screenshot 2024-04-05 at 11 43 07

but i realized, in your source x-displayName of tags is null. this is not a big deal, but if you put the key, you should also provide the value. I remember, somewhere in the code this value is checked.

on the other hand; this is the config i used if it could be a reference;

savyint: {
    specPath: "open-api-specs/savyint.yaml",
    outputDir: "docs/savyint",
    sidebarOptions: {
        groupPathsBy: "tagGroup",
        categoryLinkSource: "auto",
    }
},

Steps to reproduce; (plugin version 2.1.3)

and i can see the results.

Kkundan commented 1 month ago

thanks @bencagri but I am actually currently using 3.0.0-beta.10 and not 2.1.3 . do you see the same result in that version too ?

stakoov commented 1 month ago

The issue might be the yarn docusaurus clean-api-docs all not deleting the sidebar.js (.ts) and for some reason in version 3.0 (not sure what is behivier in versino 2.0) when gen-api-docs it's not regenerated.

@Kkundan can you delete the docs/open-api/sidebar.js/ts

Kkundan commented 1 month ago

@stakoov I have delete them and regenerated but still the same issue

Kkundan commented 1 month ago

@stakoov @bencagri would appreciate if you can extend some help , I tried all options but I am unable to make it work

bencagri commented 1 month ago

Hello @Kkundan , unfortunately I do have a busy schedule to check this up with 3.0-beta tag. I will take a glance as soon as I can.

stakoov commented 1 month ago

Hi @Kkundan I will investigate this one later this week.

Kkundan commented 1 month ago

@stakoov I see the same issue in your tryingpan app : https://docusaurus-openapi.tryingpan.dev/category/restaurant-api

docusaurus-openapi-docs-issue