Is it possible to use AJV to reference a schema that was previously not added through addSchema()?
I want to resolve a reference like this:
{
"$schema": "http://json-schema.org/draft-07/schema",
"type": "object",
"additionalProperties": false,
"properties": {
"id": {
"$ref": "project-id.schema.json#/definitions/id"
}
}
}
without explicitly adding project-id.schema.json first.
Given
answer.json
id.json
Adding all schemas at once via the
schemasoptionLoading referenced schemas with the
loadSchemaoptionIn this case you do need to pass the schema you want to compile as an object but if that schema contains references to other schemas not known by Ajv already, these will be loaded via
loadSchema: