Meta-Schema-Validation not working / no guide available
See original GitHub issueWhat version of Ajv are you using? Does the issue happen if you use the latest version?
Integrating Ajv2019 from "ajv": "^6.12.6",
with Angular
Ajv options object
const ajv = new Ajv2019({allErrors: true});
JSON Schema
Use case: Trying to validate custom schemas against meta schema draft 2019-09 e.g:
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"$id": "https://example.com/schemas/template.json",
"title": "Template",
"type": "object",
"properties": {},
"required": [],
"additionalProperties": false
}
Your code
const ajv = new Ajv2019({allErrors: true});
valid = ajv.validateSchema(json);
errors = ajv.errors;
Validation result, data AFTER validation, error messages
no schema with key or ref "https://json-schema.org/draft/2019-09/schema"
What results did you expect?
Meta-Schema validation working.
Are you going to resolve the issue?
Issue Analytics
- State:
- Created a year ago
- Comments:16 (3 by maintainers)
Top Results From Across the Web
How to Fix Schema Validation Errors
In this guide we will go over schema validation errors in more detail; specifically, the most common one, called “either “offers”, “review”, or...
Read more >Json schema validation shows no errors - Stack Overflow
Your problem is, you have no schema with the $id of http://test.com/schemas/test.json . You need to pass in the identifier (in your case, ......
Read more >API Reference | Ajv JSON schema validator
The schema passed to this method will be validated against meta-schema unless validateSchema option is false. If schema is invalid, an error will...
Read more >Schema Validation on Confluent Server
Value schema and key schema validation are independent of each other; you can enable either or both. (By default, schema validation is not...
Read more >Javascript example of meta-schema v1 - Amazon-Services-API
For JavaScript applications, the Hyperjump - JSON Schema Validator library supports ... The following example code will not work in a web browser,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Should’ve started with that.
Get the validator function directly then:
It would validate it agains draft-2019 meta-schema