-
-
Notifications
You must be signed in to change notification settings - Fork 223
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
Using dereference with base url throws errors. #130
Labels
Comments
The error message you're getting:
is caused by the missing
Add the missing
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
My Schemas look like this:
Schema1:
Schema2: (meta)
Say I use dereference without base url would lead to this error:
Error parsingSyntaxError: Invalid $ref pointer "meta". Pointers must begin with "#/"
Which is not a very helpful Error message, since belive my $ref to be correct following this guide:
https://swagger.io/docs/specification/using-ref/
Also mentioned in #42
I also tested it with these, which either threw a path error or just wrote the ref element without inserting the content:
Say I use a dereference with a base url (following #20):
jsonschema = await parser.dereference('./json_schemes/','./json_schemes/standard_message_schema.json', {});
Would lead to this Error:
If I understand this error correctly, then $RefParser trys to read a folder, which of course doesnt work. But that is not the behavior I expected. I expected the Parser to resolve refs like above, relative to the folder I give as a base url.
Or to generalize my problem:
I want to parse a folder full of json schemas so I can validate them against a json object in js.
Can I do that here?
(Coming from https://stackoverflow.com/questions/56851739/how-to-load-a-json-folder-into-javascript )
The text was updated successfully, but these errors were encountered: