resources/draft-04.json in json-schema-2.0.0 vs resources/draft-04.json in json-schema-2.0.1
- old
+ new
@@ -1,174 +1,150 @@
{
- "$schema": "http://json-schema.org/draft-03/schema#",
- "id": "http://json-schema.org/draft-03/schema#",
- "type": "object",
-
- "properties": {
- "type": {
- "type": [ "string", "array" ],
- "items": {
- "type": [ "string", { "$ref": "#" } ]
- },
- "uniqueItems": true,
- "default": "any"
+ "id": "http://json-schema.org/draft-04/schema#",
+ "$schema": "http://json-schema.org/draft-04/schema#",
+ "description": "Core schema meta-schema",
+ "definitions": {
+ "schemaArray": {
+ "type": "array",
+ "minItems": 1,
+ "items": { "$ref": "#" }
},
-
- "properties": {
- "type": "object",
- "additionalProperties": { "$ref": "#" },
- "default": {}
+ "positiveInteger": {
+ "type": "integer",
+ "minimum": 0
},
-
- "patternProperties": {
- "type": "object",
- "additionalProperties": { "$ref": "#" },
- "default": {}
+ "positiveIntegerDefault0": {
+ "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
},
-
- "additionalProperties": {
- "type": [ { "$ref": "#" }, "boolean" ],
- "default": {}
+ "simpleTypes": {
+ "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
},
-
- "items": {
- "type": [ { "$ref": "#" }, "array" ],
- "items": { "$ref": "#" },
- "default": {}
+ "stringArray": {
+ "type": "array",
+ "items": { "type": "string" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ },
+ "type": "object",
+ "properties": {
+ "id": {
+ "type": "string",
+ "format": "uri"
},
-
- "additionalItems": {
- "type": [ { "$ref": "#" }, "boolean" ],
- "default": {}
+ "$schema": {
+ "type": "string",
+ "format": "uri"
},
-
- "required": {
- "type": "boolean",
- "default": false
+ "title": {
+ "type": "string"
},
-
- "dependencies": {
- "type": "object",
- "additionalProperties": {
- "type": [ "string", "array", { "$ref": "#" } ],
- "items": {
- "type": "string"
- }
- },
- "default": {}
+ "description": {
+ "type": "string"
},
-
- "minimum": {
- "type": "number"
+ "default": {},
+ "multipleOf": {
+ "type": "number",
+ "minimum": 0,
+ "exclusiveMinimum": true
},
-
"maximum": {
"type": "number"
},
-
- "exclusiveMinimum": {
- "type": "boolean",
- "default": false
- },
-
"exclusiveMaximum": {
"type": "boolean",
"default": false
},
-
- "minItems": {
- "type": "integer",
- "minimum": 0,
- "default": 0
+ "minimum": {
+ "type": "number"
},
-
- "maxItems": {
- "type": "integer",
- "minimum": 0
- },
-
- "uniqueItems": {
+ "exclusiveMinimum": {
"type": "boolean",
"default": false
},
-
+ "maxLength": { "$ref": "#/definitions/positiveInteger" },
+ "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
"pattern": {
"type": "string",
"format": "regex"
},
-
- "minLength": {
- "type": "integer",
- "minimum": 0,
- "default": 0
+ "additionalItems": {
+ "anyOf": [
+ { "type": "boolean" },
+ { "$ref": "#" }
+ ],
+ "default": {}
},
-
- "maxLength": {
- "type": "integer"
+ "items": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/schemaArray" }
+ ],
+ "default": {}
},
-
- "enum": {
- "type": "array",
- "minItems": 1,
- "uniqueItems": true
+ "maxItems": { "$ref": "#/definitions/positiveInteger" },
+ "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "uniqueItems": {
+ "type": "boolean",
+ "default": false
},
-
- "default": {
- "type": "any"
+ "maxProperties": { "$ref": "#/definitions/positiveInteger" },
+ "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
+ "required": { "$ref": "#/definitions/stringArray" },
+ "additionalProperties": {
+ "anyOf": [
+ { "type": "boolean" },
+ { "$ref": "#" }
+ ],
+ "default": {}
},
-
- "title": {
- "type": "string"
+ "definitions": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
},
-
- "description": {
- "type": "string"
+ "properties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
},
-
- "format": {
- "type": "string"
+ "patternProperties": {
+ "type": "object",
+ "additionalProperties": { "$ref": "#" },
+ "default": {}
},
-
- "divisibleBy": {
- "type": "number",
- "minimum": 0,
- "exclusiveMinimum": true,
- "default": 1
+ "dependencies": {
+ "type": "object",
+ "additionalProperties": {
+ "anyOf": [
+ { "$ref": "#" },
+ { "$ref": "#/definitions/stringArray" }
+ ]
+ }
},
-
- "disallow": {
- "type": [ "string", "array" ],
- "items": {
- "type": [ "string", { "$ref": "#" } ]
- },
+ "enum": {
+ "type": "array",
+ "minItems": 1,
"uniqueItems": true
},
-
- "extends": {
- "type": [ { "$ref": "#" }, "array" ],
- "items": { "$ref": "#" },
- "default": {}
+ "type": {
+ "anyOf": [
+ { "$ref": "#/definitions/simpleTypes" },
+ {
+ "type": "array",
+ "items": { "$ref": "#/definitions/simpleTypes" },
+ "minItems": 1,
+ "uniqueItems": true
+ }
+ ]
},
-
- "id": {
- "type": "string",
- "format": "uri"
- },
-
- "$ref": {
- "type": "string",
- "format": "uri"
- },
-
- "$schema": {
- "type": "string",
- "format": "uri"
- }
+ "allOf": { "$ref": "#/definitions/schemaArray" },
+ "anyOf": { "$ref": "#/definitions/schemaArray" },
+ "oneOf": { "$ref": "#/definitions/schemaArray" },
+ "not": { "$ref": "#" }
},
-
"dependencies": {
- "exclusiveMinimum": "minimum",
- "exclusiveMaximum": "maximum"
+ "exclusiveMaximum": [ "maximum" ],
+ "exclusiveMinimum": [ "minimum" ]
},
-
"default": {}
}