-
Notifications
You must be signed in to change notification settings - Fork 289
Add infoPath to apiItem #968
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @omonk, thanks for reporting this issue. Definitely seems like some cleanup is in order here, at least the component names are not intuitive.
If I'm understanding correctly, you want the "authorization" component to render both inside the ApiItem and ApiExplorer components? I think we used to render it under ApiItem, before our last major redesign.
- I don't think
infoIdandinfoPathare the same values but I'll double check. It matters because theinfoPathis what's used to generate the links to the correct security scheme tab under the generated info doc. - It looks like we may have forgotten to clean up the
createAuthorizationundercreateApiPageMDbut I'll double check.
Either way, it should be possible to achieve what you're asking for, i.e. with a custom markdownGenerators function. I'll look through to see what if anything we can clean up.
If I'm understanding correctly, you want the "authorization" component to render both inside the ApiItem and ApiExplorer components?
Yep exactly, it looks as though this was the case previously as the main API template has this template condition as I mentioned.
I don't think there needs to be a custom markdown generator, just passing the infoPath to the API item that i passed around to the markdown generators is enough.
Lots of as any make things quite tricky to parse 😬
Uh oh!
There was an error while loading. Please reload this page.
Description
To be really honest I'm finding it very hard to follow a lot of the inner workings of this plugin.
I am attempting to replicate the authorization section in my local schema. There is only one security schema in my schema but the plugin choses not to render anything in the ApiItem component but it does in the ApiExplorer
This line is the offending culprit https://github.com/PaloAltoNetworks/docusaurus-openapi-docs/blob/main/packages/docusaurus-plugin-openapi-docs/src/markdown/index.ts#L84
I've seen for some reason the API item doesn't have an infoPath so this change adds the info path and renders the auth item appropriately in my project.
Perhaps you could help explain why?
This line picks out info_path of MDX frontmatter and passes it to the ApiExplorer. Unfortunately at that point the MDX for the main ApiItem has been compiled.
Motivation and Context
How Has This Been Tested?
Locally
Screenshots (if appropriate)
imageTypes of changes
Checklist