diff --git a/draft-05/README.md b/draft-05/README.md new file mode 100644 index 00000000..7a34cb9d --- /dev/null +++ b/draft-05/README.md @@ -0,0 +1,12 @@ +## Explanation for lack of draft-05 meta-schemas + +"Draft-05" in the sequential meta-schema numbering would have +referred to the draft-wright-jsonschema\*-00 specifications. + +These specifications were intended as modernized and tidied +versions of the specifications referenced by the "Draft-04" +meta-schemas, so those draft-04 meta-schemas should continue +to be used. + +"Draft-06" meta-schemas will be published for the next set of +specifications. diff --git a/draft-06/hyper-schema b/draft-06/hyper-schema new file mode 100644 index 00000000..138dcc14 --- /dev/null +++ b/draft-06/hyper-schema @@ -0,0 +1,135 @@ +{ + "$schema": "http://json-schema.org/draft-06/hyper-schema#", + "$id": "http://json-schema.org/draft-06/hyper-schema#", + "title": "JSON Hyper-Schema", + "definitions": { + "schemaArray": { + "allOf": [ + { "$ref": "http://json-schema.org/draft-06/schema#/definitions/schemaArray" }, + { + "items": { "$ref": "#" } + } + ] + }, + "linkDescription": { + "title": "Link Description Object", + "type": "object", + "required": [ "href" ], + "properties": { + "href": { + "description": "a URI template, as defined by RFC 6570", + "type": "string", + "format": "uri-template" + }, + "hrefSchema": { + "description": "a schema for validating user input to the URI template, where the input is in the form of a JSON object with property names matching variable names in \"href\"", + "allOf": [ {"$ref": "#"} ] + }, + "rel": { + "description": "relation to the target resource of the link", + "type": "string" + }, + "title": { + "description": "a title for the link", + "type": "string" + }, + "targetSchema": { + "description": "JSON Schema describing the link target", + "allOf": [ { "$ref": "#" } ] + }, + "mediaType": { + "description": "media type (as defined by RFC 2046) describing the link target", + "type": "string" + }, + "method": { + "description": "specifies that the client can construct a templated query (\"get\") or non-idempotent request (\"post\") to a resource.", + "type": "string" + }, + "encType": { + "description": "The media type in which to submit data along with the request", + "type": "string", + "default": "application/json" + }, + "schema": { + "description": "Schema describing the data to submit along with the request", + "allOf": [ { "$ref": "#" } ] + } + } + } + }, + "allOf": [ { "$ref": "http://json-schema.org/draft-06/schema#" } ], + "properties": { + "additionalItems": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ] + }, + "additionalProperties": { + "anyOf": [ + { "type": "boolean" }, + { "$ref": "#" } + ] + }, + "dependencies": { + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "type": "array" } + ] + } + }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ] + }, + "definitions": { + "additionalProperties": { "$ref": "#" } + }, + "patternProperties": { + "additionalProperties": { "$ref": "#" } + }, + "properties": { + "additionalProperties": { "$ref": "#" } + }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" }, + + "base": { + "description": "URI Template resolved as for the 'href' keyword in the Link Description Object. The resulting URI Reference is resolved against the current URI base and sets the new URI base for URI references within the instance.", + "type": "string" + }, + "links": { + "type": "array", + "items": { "$ref": "#/definitions/linkDescription" } + }, + "media": { + "type": "object", + "properties": { + "type": { + "description": "A media type, as described in RFC 2046", + "type": "string" + }, + "binaryEncoding": { + "description": "A content encoding scheme, as described in RFC 2045", + "type": "string" + } + } + }, + "readOnly": { + "description": "If true, indicates that the value of this property is controlled by the server.", + "type": "boolean", + "default": "false" + } + }, + "links": [ + { + "rel": "self", + "href": "{+%24id}" + } + ] +} diff --git a/draft-06/links b/draft-06/links new file mode 100644 index 00000000..e4223575 --- /dev/null +++ b/draft-06/links @@ -0,0 +1,47 @@ +{ + "$schema": "http://json-schema.org/draft-06/hyper-schema#", + "$id": "http://json-schema.org/draft-06/links#", + "title": "Link Description Object", + "type": "object", + "required": [ "href" ], + "properties": { + "href": { + "description": "a URI template, as defined by RFC 6570", + "type": "string", + "format": "uri-template" + }, + "hrefSchema": { + "description": "a schema for validating user input to the URI template, where the input is in the form of a JSON object with property names matching variable names in \"href\"", + "allOf": [ {"$ref": "#"} ] + }, + "rel": { + "description": "relation to the target resource of the link", + "type": "string" + }, + "title": { + "description": "a title for the link", + "type": "string" + }, + "targetSchema": { + "description": "JSON Schema describing the link target", + "allOf": [ { "$ref": "hyper-schema#" } ] + }, + "mediaType": { + "description": "media type (as defined by RFC 2046) describing the link target", + "type": "string" + }, + "method": { + "description": "specifies that the client can construct a templated query (\"get\") or non-idempotent request (\"post\") to a resource.", + "type": "string" + }, + "encType": { + "description": "The media type in which to submit data along with the request", + "type": "string", + "default": "application/json" + }, + "schema": { + "description": "Schema describing the data to submit along with the request", + "allOf": [ { "$ref": "hyper-schema#" } ] + } + } +} diff --git a/draft-06/schema b/draft-06/schema new file mode 100644 index 00000000..621cc510 --- /dev/null +++ b/draft-06/schema @@ -0,0 +1,150 @@ +{ + "$schema": "http://json-schema.org/draft-06/schema#", + "$id": "http://json-schema.org/draft-06/schema#", + "title": "Core schema meta-schema", + "definitions": { + "schemaArray": { + "type": "array", + "minItems": 1, + "items": { "$ref": "#" } + }, + "nonNegativeInteger": { + "type": "integer", + "minimum": 0 + }, + "nonNegativeIntegerDefault0": { + "allOf": [ + { "$ref": "#/definitions/nonNegativeInteger" }, + { "default": 0 } + ] + }, + "simpleTypes": { + "enum": [ + "array", + "boolean", + "integer", + "null", + "number", + "object", + "string" + ] + }, + "stringArray": { + "type": "array", + "items": { "type": "string" }, + "uniqueItems": true, + "default": [] + } + }, + "type": ["object", "boolean"], + "properties": { + "$id": { + "type": "string", + "format": "uri-reference" + }, + "$schema": { + "type": "string", + "format": "uri" + }, + "$ref": { + "type": "string", + "format": "uri-reference" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "default": {}, + "multipleOf": { + "type": "number", + "exclusiveMinimum": 0 + }, + "maximum": { + "type": "number" + }, + "exclusiveMaximum": { + "type": "number" + }, + "minimum": { + "type": "number" + }, + "exclusiveMinimum": { + "type": "number" + }, + "maxLength": { "$ref": "#/definitions/nonNegativeInteger" }, + "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "pattern": { + "type": "string", + "format": "regex" + }, + "additionalItems": { "$ref": "#" }, + "items": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/schemaArray" } + ], + "default": {} + }, + "maxItems": { "$ref": "#/definitions/nonNegativeInteger" }, + "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "uniqueItems": { + "type": "boolean", + "default": false + }, + "contains": { "$ref": "#" }, + "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" }, + "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" }, + "required": { "$ref": "#/definitions/stringArray" }, + "additionalProperties": { "$ref": "#" }, + "definitions": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "properties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "patternProperties": { + "type": "object", + "additionalProperties": { "$ref": "#" }, + "default": {} + }, + "dependencies": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { "$ref": "#" }, + { "$ref": "#/definitions/stringArray" } + ] + } + }, + "propertyNames": { "$ref": "#" }, + "const": {}, + "enum": { + "type": "array", + "minItems": 1, + "uniqueItems": true + }, + "type": { + "anyOf": [ + { "$ref": "#/definitions/simpleTypes" }, + { + "type": "array", + "items": { "$ref": "#/definitions/simpleTypes" }, + "minItems": 1, + "uniqueItems": true + } + ] + }, + "format": { "type": "string" }, + "allOf": { "$ref": "#/definitions/schemaArray" }, + "anyOf": { "$ref": "#/definitions/schemaArray" }, + "oneOf": { "$ref": "#/definitions/schemaArray" }, + "not": { "$ref": "#" } + }, + "default": {} +}