Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
omonk wants to merge 1 commit into PaloAltoNetworks:main
base: main
Choose a base branch
Loading
from omonk:pass-info-path-to-api-page

Conversation

@omonk
Copy link
Contributor

@omonk omonk commented Sep 16, 2024
edited
Loading

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)

image

Types of changes

  • Bug fix?

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.

Copy link
Member

sserrata commented Sep 16, 2024
edited
Loading

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 infoId and infoPath are the same values but I'll double check. It matters because the infoPath is 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 createAuthorization under createApiPageMD but 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.

Copy link
Contributor Author

omonk commented Sep 16, 2024

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 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /