What are the features present in the schema draft 4 that are not in the JSON schema draft 3 produced by IETF ?
The current version is 2020-12! The previous version was 2019-09.
Draft 4 defined a value for $schema without a specific dialect ( http://json-schema.org/schema# ) which meant, use the latest dialect. This has since been deprecated and should no longer be used. You might come across references to Draft 5. There is no Draft 5 release of JSON Schema.
JSON (JavaScript Object Notation) is a simple and lightweight text-based data format. JSON Schema is an IETF standard providing a format for what JSON data is required for a given application and how to interact with it.
The simplest way to check if JSON is valid is to load the JSON into a JObject or JArray and then use the IsValid(JToken, JsonSchema) method with the JSON Schema. To get validation error messages, use the IsValid(JToken, JsonSchema, IList<String> ) or Validate(JToken, JsonSchema, ValidationEventHandler) overloads.
From the change logs:
New keywords
Removed:
Changed in functionality:
Before
{
"type": [ "string", { "other": "schema" } ]
}
Now
{
"anyOf": [
{ "type": "string" },
{ "other": "schema" }
]
}
Before
{
"properties": {
"p": {
"type": "string",
"required": true
},
"q": {
"type": "string",
"required": true
}
}
}
Now
{
"properties": {
"p": { "type": "string" },
"q": { "type": "string" }
},
"required": [ "p", "q" ]
}
Before
{
"dependencies": { "a": "b" }
}
Now
{
"dependencies": { "a": [ "b" ] }
}
If you're interested in a deep dive, you can review a diff between the two drafts on the IETF site.
However, if you're looking for a simpler summary of changes, Geraint Luff and Francis Galiegue created a changelog page on the project's github wiki that lists the changes, additions, and removals.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With