From 4be0cbff74081e4b9f8ab4a177e75d36ab789c2c Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Wed, 11 Oct 2017 11:41:21 -0700 Subject: [PATCH 1/2] Bugfixes for draft-04 meta-schemas * "format" was missing * "uri" was used impropertly (causeing conformance test confusion) * "readOnly" was missing --- hyper-schema.json | 5 +++++ links.json | 2 +- schema.json | 7 +++---- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/hyper-schema.json b/hyper-schema.json index 3279ad9f..a19bb0fe 100644 --- a/hyper-schema.json +++ b/hyper-schema.json @@ -116,6 +116,11 @@ "$ref": "#" } } + }, + "readOnly": { + "description": "If true, indicates that the value of this property is controlled by the server.", + "type": "boolean", + "default": false } }, "links": [ diff --git a/links.json b/links.json index de272cc4..a40c0278 100644 --- a/links.json +++ b/links.json @@ -38,4 +38,4 @@ "dependencies" : { "enctype" : "method" } -} \ No newline at end of file +} diff --git a/schema.json b/schema.json index 85eb502a..bcbb8474 100644 --- a/schema.json +++ b/schema.json @@ -28,12 +28,10 @@ "type": "object", "properties": { "id": { - "type": "string", - "format": "uri" + "type": "string" }, "$schema": { - "type": "string", - "format": "uri" + "type": "string" }, "title": { "type": "string" @@ -137,6 +135,7 @@ } ] }, + "format": { "type": "string" }, "allOf": { "$ref": "#/definitions/schemaArray" }, "anyOf": { "$ref": "#/definitions/schemaArray" }, "oneOf": { "$ref": "#/definitions/schemaArray" }, From 73a78fb9ed0fd2a6ad81b8b9ee17a35d57b58529 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 17 Jan 2025 14:16:29 -0400 Subject: [PATCH 2/2] Fix `links` not adhering to its meta-schema given invalid `dependencies` In Draft 4, `dependencies` is either a schema or an array of unique strings. See: https://json-schema.org/draft-04/draft-fge-json-schema-validation-00#rfc.section.5.4.5 See: https://www.learnjsonschema.com/draft4/validation/dependencies/ Signed-off-by: Juan Cruz Viotti --- links.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/links.json b/links.json index de272cc4..5c0d30d9 100644 --- a/links.json +++ b/links.json @@ -36,6 +36,6 @@ "required" : ["rel", "href"], "dependencies" : { - "enctype" : "method" + "enctype" : ["method"] } } \ No newline at end of file