-
-
Notifications
You must be signed in to change notification settings - Fork 887
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 resolveRefs option or method #454
Comments
duplicate of #22 |
$ref is not equivalent to schema inclusion - the expectation you have is wrong. You can read more on the issue in various discussions in JSON-schema-org, this is the last json-schema-org/json-schema-spec#279 (comment) |
It affects code generation - with this option |
For a subset of possible JSON-schemas $ref can be seen as pre-processing instruction to include the referenced schema in place. In general case such pre-processing is NOT possible. Performing any schema manipulation, including inlining $refs in place, is out of scope of this package. The scope of this package is validating data against given schema (specifically, generating code to validate data). |
Fair enough. Thanks. |
What version of Ajv are you using? Does the issue happen if you use the latest version?
v4.11.5
Ajv options object (see https://github.com/epoberezkin/ajv#options):
JSON Schema (please make it as small as possible to reproduce the issue):
Your code (please use
options
,schema
anddata
as variables):See RunKit example.
Outputs:
What results did you expect?
I need
$ref
values to be resolved within the compiled schema. But (as noted in docs).compile()
method stores the schema as a reference without resolving references.inlineRefs
option seems to be used for inlining referenced schemas but it doesn't.extendRefs
is something else either.The text was updated successfully, but these errors were encountered: