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

Issue with some $ref #183

Closed
jy95 opened this issue Dec 16, 2019 · 2 comments · Fixed by #184
Closed

Issue with some $ref #183

jy95 opened this issue Dec 16, 2019 · 2 comments · Fixed by #184

Comments

@jy95
Copy link
Contributor

jy95 commented Dec 16, 2019

Hello,

I saw it is possible to split specifications into multiple files.
I tried to split mine ( from my master branch ) into a separate branch : the "main file" and the rest

( I didn't forget to escape special characters like explained in Swagger : https://swagger.io/docs/specification/using-ref/ or in this old open api v2 tutorial )

To test if the specifications are correct (and work as expected), I used the following commands explained in my readme :

image

The validator seems to accept the specifications :

image

However, some endpoints like /auth/login and /auth/register no longer work and send me an error of this type :

image

Any idea what caused this problem? The path seems to be recognized in other tools ( like the OpenAPI (Swagger) Editor extension in Visual Studio Code )

image

Thanks

@jy95
Copy link
Contributor Author

jy95 commented Dec 16, 2019

@cdimascio I found the explanation : it is an issue of json-schema-ref-parser
APIDevTools/json-schema-ref-parser#44

As explained here ( APIDevTools/json-schema-ref-parser#101 (comment) ) , we must use :

$RefParser.dereference(filePath)

instead of

$RefParser.bundle(filePath)

If I changed that in your framework/index.js , my tests pass again :

image

cdimascio added a commit that referenced this issue Dec 24, 2019
Fix $ref issue  with special characters (#183)
@cdimascio
Copy link
Owner

cdimascio commented Dec 24, 2019

@jy95, merged your PR. the new option for the json schema ref parser is available in v3.3.0

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 a pull request may close this issue.

2 participants