Skip to content
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

Add more debug info to resolveJsonRefs #560

Merged
merged 2 commits into from
Apr 24, 2023

Conversation

Cellaryllis
Copy link
Contributor

Description

Add footprint formation when resolving references fails

Motivation and Context

I opened an issue (#559) because I received an error that looked like there was something wrong in the plugin, but it turned out to be a typo in my project somewhere. Adding the footprint allows developers to see where in the spec something failed.

Below message was reported which didn't help me too much.

Could not find resolver for "g:/[somepath...]/ApiCommons.yml%22"
SyntaxError: Unexpected token u in JSON at position 0
WARNING: the following OpenAPI spec returned undefined: G:/[somepath...]/Api.yml

How Has This Been Tested?

Built the plugin and referenced it in my project, caused it to fail and that resulted in a better error that helps me find out where the error is.

Error: [Could not find resolver for "g:/[somepath...]/SimplyPluralApiDocs/node_modules/@apidevtools/json-schema-ref-parser/dist/SimplyPluralApiCommons.yml'"] with footprint [paths,/v1/chat/category/:id,get,parameters,0,description+g:/[somepath...]/SimplyPluralApiDocs/node_modules/@apidevtools/json-schema-ref-parser/dist/+EUNMATCHEDRESOLVER+Could not find resolver for "g:/[somepath...]/SimplyPluralApiDocs/node_modules/@apidevtools/json-schema-ref-parser/dist/SimplyPluralApiCommons.yml'"]
SyntaxError: Unexpected token u in JSON at position 0
WARNING: the following OpenAPI spec returned undefined: G:\[somepath...]\SimplyPluralApiDocs\SimplyPluralApi.yml

Note: I replaced my root path with "[somepath...]"

Types of changes

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

Checklist

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

@welcome-to-palo-alto-networks

🎉 Thanks for opening this pull request! We really appreciate contributors like you! 🙌

@Cellaryllis Cellaryllis temporarily deployed to default April 23, 2023 05:33 — with GitHub Actions Inactive
@github-actions
Copy link

Visit the preview URL for this PR (updated for commit 5a1e1a9):

https://docusaurus-openapi-36b86--pr560-gyufpv8j.web.app

(expires Wed, 24 May 2023 14:36:19 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Copy link
Member

@sserrata sserrata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sserrata sserrata merged commit 29dc79c into PaloAltoNetworks:main Apr 24, 2023
@welcome-to-palo-alto-networks

🎉 Congrats on getting your first pull request merged! We here at Palo Alto Networks are so grateful! ❤️

sserrata pushed a commit that referenced this pull request Apr 24, 2023
* Add more debug info to resolveJsonRefs

* Improve error message
blindaa121 pushed a commit that referenced this pull request May 2, 2023
* Add more debug info to resolveJsonRefs

* Improve error message
This was referenced May 5, 2023
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