Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 23 additions & 11 deletions hyper-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"allOf": [
{ "$ref": "http://json-schema.org/drafts/schema" },
{
"items": { "$ref": "#" }
"items": { "$ref": "#/definitions/subSchema" }
}
]
},
Expand All @@ -30,7 +30,7 @@
},
"targetSchema": {
"description": "JSON Schema describing the link target",
"allOf": [ { "$ref": "#" } ]
"allOf": [ { "$ref": "#/definitions/subSchema" } ]
},
"mediaType": {
"description": "media type (as defined by RFC 2046) describing the link target",
Expand All @@ -47,52 +47,64 @@
},
"schema": {
"description": "Schema describing the data to submit along with the request",
"allOf": [ { "$ref": "#" } ]
"allOf": [ { "$ref": "#/definitions/subSchema" } ]
}
}
},
"subSchema": {
"oneOf": [
{
"allOf": [
{ "$ref": "#" },
{ "$ref": "http://json-schema.org/draft/schema#/definitions/notJsonReference" }
]
},
{ "$ref": "http://json-schema.org/draft/schema#/definitions/jsonReference" }
]
}
},

"allOf": [ { "$ref": "http://json-schema.org/draft/schema#" } ],
"properties": {
"additionalItems": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
{ "$ref": "#/definitions/subSchema" }
]
},
"additionalProperties": {
"anyOf": [
{ "type": "boolean" },
{ "$ref": "#" }
{ "$ref": "#/definitions/subSchema" }
]
},
"dependencies": {
"additionalProperties": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/subSchema" },
{ "type": "array" }
]
}
},
"items": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/subSchema" },
{ "$ref": "#/definitions/schemaArray" }
]
},
"definitions": {
"additionalProperties": { "$ref": "#" }
"additionalProperties": { "$ref": "#/definitions/subSchema" }
},
"patternProperties": {
"additionalProperties": { "$ref": "#" }
"additionalProperties": { "$ref": "#/definitions/subSchema" }
},
"properties": {
"additionalProperties": { "$ref": "#" }
"additionalProperties": { "$ref": "#/definitions/subSchema" }
},
"allOf": { "$ref": "#/definitions/schemaArray" },
"anyOf": { "$ref": "#/definitions/schemaArray" },
"oneOf": { "$ref": "#/definitions/schemaArray" },
"not": { "$ref": "#" },
"not": { "$ref": "#/definitions/subSchema" },

"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.",
Expand Down
44 changes: 35 additions & 9 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,25 @@
"id": "http://json-schema.org/draft/schema#",
"title": "Core schema meta-schema",
"definitions": {
"jsonReference": {
"type": "object",
"properties": {
"$ref": {
"type": "string",
"format": "uriref"
}
},
"required": [ "$ref" ]
},
"notJsonReference": {
"not": {
"required": [ "$ref" ]
}
},
"schemaArray": {
"type": "array",
"minItems": 1,
"items": { "$ref": "#" }
"items": { "$ref": "#/definitions/subSchema" }
},
"positiveInteger": {
"type": "integer",
Expand All @@ -33,6 +48,17 @@
"type": "array",
"items": { "type": "string" },
"uniqueItems": true
},
"subSchema": {
"oneOf": [
{
"allOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/notJsonReference" }
]
},
{ "$ref": "#/definitions/jsonReference" }
]
}
},
"type": ["object", "boolean"],
Expand Down Expand Up @@ -77,10 +103,10 @@
"type": "string",
"format": "regex"
},
"additionalItems": { "$ref": "#" },
"additionalItems": { "$ref": "#/definitions/subSchema" },
"items": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/subSchema" },
{ "$ref": "#/definitions/schemaArray" }
],
"default": {}
Expand All @@ -95,27 +121,27 @@
"maxProperties": { "$ref": "#/definitions/positiveInteger" },
"minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
"required": { "$ref": "#/definitions/stringArray" },
"additionalProperties": { "$ref": "#" },
"additionalProperties": { "$ref": "#/definitions/subSchema" },
"definitions": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"additionalProperties": { "$ref": "#/definitions/subSchema" },
"default": {}
},
"properties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"additionalProperties": { "$ref": "#/definitions/subSchema" },
"default": {}
},
"patternProperties": {
"type": "object",
"additionalProperties": { "$ref": "#" },
"additionalProperties": { "$ref": "#/definitions/subSchema" },
"default": {}
},
"dependencies": {
"type": "object",
"additionalProperties": {
"anyOf": [
{ "$ref": "#" },
{ "$ref": "#/definitions/subSchema" },
{ "$ref": "#/definitions/stringArray" }
]
}
Expand All @@ -142,7 +168,7 @@
"allOf": { "$ref": "#/definitions/schemaArray" },
"anyOf": { "$ref": "#/definitions/schemaArray" },
"oneOf": { "$ref": "#/definitions/schemaArray" },
"not": { "$ref": "#" }
"not": { "$ref": "#/definitions/subSchema" }
},
"dependencies": {
"exclusiveMaximum": [ "maximum" ],
Expand Down