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

relative $ref not resolving #877

Closed
terazus opened this issue Nov 1, 2018 · 1 comment
Closed

relative $ref not resolving #877

terazus opened this issue Nov 1, 2018 · 1 comment
Labels

Comments

@terazus
Copy link

terazus commented Nov 1, 2018

What version of Ajv are you using? Does the issue happen if you use the latest version?
6.5.4
When trying to resolved relative $ref, the algorythm returns there error:

MissingRefError: can't resolve reference identifier_info_schema.json# from id https://w3id.org/dats/schema/person_schema.json#

JSON Schema

see: https://raw.githubusercontent.com/datatagsuite/schema/master/person_schema.json
the json input being a bit big, i don't want to overflow this thread

Your code

code is available here: https://runkit.com/terazus/5bdb2df069012300129cdc73

I'm either doing something wrong in my code, or in my schemas, i guess.

Ty

@epoberezkin
Copy link
Member

I assume the expectation is that this this schema should be loaded from URL https://w3id.org/dats/schema/identifier_info_schema.json#? The standard usage is to add all necessary schemas using addSchema. Ajv does not do any I/O unless you use compileAsync method and loadSchema option (see https://github.com/epoberezkin/ajv#asynchronous-schema-compilation)

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

No branches or pull requests

2 participants