Include failing property in violation json
See original GitHub issueI am migrating from the older json-schema-validator. The detail of a violation is slightly less detailed. For example in yours,
{
"schemaLocation": "#",
"pointerToViolation": "#",
"causingExceptions": [
{
"schemaLocation": "#/properties/document",
"pointerToViolation": "#/document",
"causingExceptions": [],
"keyword": "required",
"message": "required key [name] not found"
}
],
"keyword": "allOf",
"message": "#: only 1 subschema matches out of 2"
}
whereas the older library outputs:
{
"level": "error",
"schema": {
"loadingURI": "/1.0/entities/metadata/document.json#",
"pointer": "/properties/document"
},
"instance": {
"pointer": "/document"
},
"domain": "validation",
"keyword": "required",
"message": "object has missing required properties ([\"name\"])",
"required": [
"name"
],
"missing": [
"name"
]
}
To extract the name
property I will have to parse the message
, rather than the key being available directly.
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Json schema does not fail if properties of schema and json file ...
1 Answer 1 ... "address": { "type": "object", "additionalProperties": false,. in this case adding an extra category property to the address will ...
Read more >12.18.7 JSON Schema Validation Functions
If the JSON document fails validation, the function returns a JSON object which includes the properties listed here: valid : Always "false" for...
Read more >JSON validation - IBM
To ensure that misspelled and unwanted JSON objects and properties are detected by validation, set the "additionalProperties": "false" property in the JSON ......
Read more >HTTP status and error codes for JSON | Cloud Storage
Failed requests return status codes in the 4xx and 5xx ranges. ... Error responses usually include a JSON document in the response body,...
Read more >Json Schema Property Names - iT1 Source
documents conforming to JSON Schema Draft 4 specification The problem is that I want to add all JSON property names and. This allows...
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
Yes, I’m not asking for backwards incompatible changes but enough details to easily extract out all of the information. If this is planned then you can close this, and thanks!
Hello @doko123 this error message doesn’t look any familiar for me. Probably you are looking at the wrong project.