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

Validate with #/.. does't work when used with custom keywords #1001

Closed
ovx opened this issue Apr 25, 2019 · 3 comments
Closed

Validate with #/.. does't work when used with custom keywords #1001

ovx opened this issue Apr 25, 2019 · 3 comments

Comments

@ovx
Copy link

ovx commented Apr 25, 2019

What version of Ajv are you using? Does the issue happen if you use the latest version?

6.10

Ajv options object
JSON Schema
Sample data
Your code

https://runkit.com/embed/gfk2ixcd5gbp

Validation result, data AFTER validation, error messages

Error: no schema with key or ref "#/definitions/Data"

What results did you expect?

To find and validate the schema. It works without the custom keyword (just remove addKeyword and it works as expected).

Are you going to resolve the issue?

I have no clue why is this happening and how to fix it.

@epoberezkin
Copy link
Member

Weird. It does it even if the keyword is not used: https://runkit.com/esp/5cc168d8b741f4001afde85e

@epoberezkin
Copy link
Member

Actually, a bigger question is why it works without addKeyword... You need to use $id with schemas that are added (rather than just compiled).

@ovx
Copy link
Author

ovx commented Apr 25, 2019

Yes, it works with $id. Thanks

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

No branches or pull requests

2 participants