From fe19ca2ccd9d201d0f8da210cc6340217e4a3881 Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Sat, 16 Jun 2018 20:04:46 -0700 Subject: [PATCH 1/2] Remove default value for meta-schema With default values now having implication for both assertions and annotation collection, it no longer makes sense to have a default value for subschemas. Keywords such as "additionalProperties" now collect annotation information based on the instance properties to which thier subschema(s) are applied. This means that a subschema of true will cause a property to appear in the annotation, while an absent subschema will not. Therefore, a default of true does not match the annotation collection behavior and is not accurate. Additionally, as written this has always been problematic, as it claims a default true value for "not", which would in fact cause all schemas without "not" to fail. --- schema.json | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/schema.json b/schema.json index 182eefb0..7addb46b 100644 --- a/schema.json +++ b/schema.json @@ -106,8 +106,7 @@ "anyOf": [ { "$ref": "#" }, { "$ref": "#/$defs/schemaArray" } - ], - "default": true + ] }, "maxItems": { "$ref": "#/$defs/nonNegativeInteger" }, "minItems": { "$ref": "#/$defs/nonNegativeIntegerDefault0" }, @@ -162,13 +161,12 @@ "format": { "type": "string" }, "contentMediaType": { "type": "string" }, "contentEncoding": { "type": "string" }, - "if": {"$ref": "#"}, - "then": {"$ref": "#"}, - "else": {"$ref": "#"}, + "if": { "$ref": "#" }, + "then": { "$ref": "#" }, + "else": { "$ref": "#" }, "allOf": { "$ref": "#/$defs/schemaArray" }, "anyOf": { "$ref": "#/$defs/schemaArray" }, "oneOf": { "$ref": "#/$defs/schemaArray" }, "not": { "$ref": "#" } - }, - "default": true + } } From ec6472783e49d4882f134f2a7a0bbd73c0a7fd2c Mon Sep 17 00:00:00 2001 From: Henry Andrews Date: Sat, 16 Jun 2018 20:10:57 -0700 Subject: [PATCH 2/2] Add defaults for LDO schemas While it no longer makes sense to have a universal default schema value (see previous commit), the LDO schema keywords have specific implications which do match one or the other boolean schema. This commit adds the appropraite one. By default, a resource is assumed to provide or accept any structure as its representation, accept any structure for processing if it does processing at all, and to allow any header usage. So targetSchema, submissionSchema, and headerSchema all default to true. However, by default, URI templates may not be resolved from input, so headerSchema defaults to false. --- links.json | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/links.json b/links.json index addd1f06..77370131 100644 --- a/links.json +++ b/links.json @@ -29,7 +29,8 @@ "format": "uri-template" }, "hrefSchema": { - "$ref": "http://json-schema.org/draft-08/hyper-schema#" + "$ref": "http://json-schema.org/draft-08/hyper-schema#", + "default": false }, "templatePointers": { "type": "object", @@ -55,21 +56,24 @@ "type": "string" }, "targetSchema": { - "$ref": "http://json-schema.org/draft-08/hyper-schema#" + "$ref": "http://json-schema.org/draft-08/hyper-schema#", + "default": true }, "targetMediaType": { "type": "string" }, "targetHints": { }, "headerSchema": { - "$ref": "http://json-schema.org/draft-08/hyper-schema#" + "$ref": "http://json-schema.org/draft-08/hyper-schema#", + "default": true }, "submissionMediaType": { "type": "string", "default": "application/json" }, "submissionSchema": { - "$ref": "http://json-schema.org/draft-08/hyper-schema#" + "$ref": "http://json-schema.org/draft-08/hyper-schema#", + "default": true }, "$comment": { "type": "string"