Add strict mode for JSON Schema validation
Are you missing a feature? Request its implementation here.
-
- Posts: 2
- Joined: Sat May 25, 2019 5:19 pm
Add strict mode for JSON Schema validation
Post by sspringett »
The JSON schema group has consistently rejected strict validation modes - see https://github.com/json-schema-org/json ... issues/682
However, as an author of JSON schemas, this is a really useful feature, which I wished JSON schema supported. When testing a JSON document against a JSON schema which I've created, I'd like to know if the JSON document is being validated strictly based on the properties defined in the schema, or if there were undefined properties in the JSON document.
Due to JSON schema not supporting strict validation, it's not simple to create test cases for positive validation. It's possible, but results in a lot of extra work just to perform positive test cases.
I would like some kind of feedback in Oxygen that the document I'm validating strictly conforms to a given schema (uses only the properties and property patterns defined), or validates loosely. If loose validation detected, I'd like information as to what properties are not defined in the schema.
Thanks and keep up the great work!
However, as an author of JSON schemas, this is a really useful feature, which I wished JSON schema supported. When testing a JSON document against a JSON schema which I've created, I'd like to know if the JSON document is being validated strictly based on the properties defined in the schema, or if there were undefined properties in the JSON document.
Due to JSON schema not supporting strict validation, it's not simple to create test cases for positive validation. It's possible, but results in a lot of extra work just to perform positive test cases.
I would like some kind of feedback in Oxygen that the document I'm validating strictly conforms to a given schema (uses only the properties and property patterns defined), or validates loosely. If loose validation detected, I'd like information as to what properties are not defined in the schema.
Thanks and keep up the great work!
-
- Posts: 388
- Joined: Thu Jul 01, 2004 12:29 pm
Re: Add strict mode for JSON Schema validation
Hello,
Thanks for your feedback.
For JSON Schema validation, we automatically show warnings for each property that is not recognized in the current schema version.
For the validation of a JSON instance with a JSON Schema, you need to add in the JSON Schema the "additionalProperties": false construct on each property definition. This means that only the defined properties are allowed to be inserted as child, any other property will be marked as invalid.
Maybe we could add an option for strict validation of JSON instances, but this will be in conflict with the "additionalProperties" values from the JSON Schema. This option will overwrite all the "additionalProperties" from the JSON Schema, and set them to false.
Best Regards,
Octavian
Thanks for your feedback.
For JSON Schema validation, we automatically show warnings for each property that is not recognized in the current schema version.
For the validation of a JSON instance with a JSON Schema, you need to add in the JSON Schema the "additionalProperties": false construct on each property definition. This means that only the defined properties are allowed to be inserted as child, any other property will be marked as invalid.
Maybe we could add an option for strict validation of JSON instances, but this will be in conflict with the "additionalProperties" values from the JSON Schema. This option will overwrite all the "additionalProperties" from the JSON Schema, and set them to false.
Best Regards,
Octavian
Octavian Nadolu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service