From 6b0a93e576188ed59e7c6e080ce86d1fa53db4c6 Mon Sep 17 00:00:00 2001 From: David Lai Date: Fri, 9 Nov 2018 15:11:01 +0800 Subject: [PATCH 1/2] Lock current schemas\' version at Draft04 --- avalon/schema/application-1.0.json | 2 +- avalon/schema/asset-1.0.json | 2 +- avalon/schema/asset-2.0.json | 2 +- avalon/schema/config-1.0.json | 2 +- avalon/schema/container-1.0.json | 2 +- avalon/schema/container-2.0.json | 2 +- avalon/schema/inventory-1.0.json | 2 +- avalon/schema/project-2.0.json | 2 +- avalon/schema/representation-1.0.json | 2 +- avalon/schema/representation-2.0.json | 2 +- avalon/schema/session-1.0.json | 2 +- avalon/schema/shaders-1.0.json | 2 +- avalon/schema/subset-1.0.json | 2 +- avalon/schema/subset-2.0.json | 2 +- avalon/schema/version-1.0.json | 2 +- avalon/schema/version-2.0.json | 2 +- 16 files changed, 16 insertions(+), 16 deletions(-) diff --git a/avalon/schema/application-1.0.json b/avalon/schema/application-1.0.json index 3b031c159..f68a758de 100644 --- a/avalon/schema/application-1.0.json +++ b/avalon/schema/application-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:application-1.0", "description": "An application definition.", diff --git a/avalon/schema/asset-1.0.json b/avalon/schema/asset-1.0.json index cbe6dfe27..337e02729 100644 --- a/avalon/schema/asset-1.0.json +++ b/avalon/schema/asset-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:asset-1.0", "description": "A unit of data", diff --git a/avalon/schema/asset-2.0.json b/avalon/schema/asset-2.0.json index 582d3548b..9b859c4f2 100644 --- a/avalon/schema/asset-2.0.json +++ b/avalon/schema/asset-2.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:asset-2.0", "description": "A unit of data", diff --git a/avalon/schema/config-1.0.json b/avalon/schema/config-1.0.json index 97392e9dd..7d70d31c5 100644 --- a/avalon/schema/config-1.0.json +++ b/avalon/schema/config-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:config-1.0", "description": "A project configuration.", diff --git a/avalon/schema/container-1.0.json b/avalon/schema/container-1.0.json index da5af0a8b..411e814a4 100644 --- a/avalon/schema/container-1.0.json +++ b/avalon/schema/container-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:container-1.0", "description": "A loaded asset", diff --git a/avalon/schema/container-2.0.json b/avalon/schema/container-2.0.json index c8ec2e1bd..c8fb2b551 100644 --- a/avalon/schema/container-2.0.json +++ b/avalon/schema/container-2.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:container-2.0", "description": "A loaded asset", diff --git a/avalon/schema/inventory-1.0.json b/avalon/schema/inventory-1.0.json index 84395d89d..36d0da866 100644 --- a/avalon/schema/inventory-1.0.json +++ b/avalon/schema/inventory-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:config-1.0", "description": "A project configuration.", diff --git a/avalon/schema/project-2.0.json b/avalon/schema/project-2.0.json index a3a655bd4..93c74f85b 100644 --- a/avalon/schema/project-2.0.json +++ b/avalon/schema/project-2.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:project-2.0", "description": "A unit of data", diff --git a/avalon/schema/representation-1.0.json b/avalon/schema/representation-1.0.json index 252a9b746..f24bb88e7 100644 --- a/avalon/schema/representation-1.0.json +++ b/avalon/schema/representation-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:representation-1.0", "description": "The inverse of an instance", diff --git a/avalon/schema/representation-2.0.json b/avalon/schema/representation-2.0.json index e2f34ff51..a824b567d 100644 --- a/avalon/schema/representation-2.0.json +++ b/avalon/schema/representation-2.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:representation-2.0", "description": "The inverse of an instance", diff --git a/avalon/schema/session-1.0.json b/avalon/schema/session-1.0.json index 2ac01c9f3..dc7374d15 100644 --- a/avalon/schema/session-1.0.json +++ b/avalon/schema/session-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:session-1.0", "description": "The Avalon environment", diff --git a/avalon/schema/shaders-1.0.json b/avalon/schema/shaders-1.0.json index c15878717..c9186496a 100644 --- a/avalon/schema/shaders-1.0.json +++ b/avalon/schema/shaders-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:shaders-1.0", "description": "Relationships between shaders and Avalon IDs", diff --git a/avalon/schema/subset-1.0.json b/avalon/schema/subset-1.0.json index 2a5f86173..0ee38f3ff 100644 --- a/avalon/schema/subset-1.0.json +++ b/avalon/schema/subset-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:subset-1.0", "description": "A container of instances", diff --git a/avalon/schema/subset-2.0.json b/avalon/schema/subset-2.0.json index e79e0d1be..372b64df8 100644 --- a/avalon/schema/subset-2.0.json +++ b/avalon/schema/subset-2.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:subset-2.0", "description": "A container of instances", diff --git a/avalon/schema/version-1.0.json b/avalon/schema/version-1.0.json index 894249579..8ac1621b8 100644 --- a/avalon/schema/version-1.0.json +++ b/avalon/schema/version-1.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:version-1.0", "description": "An individual version", diff --git a/avalon/schema/version-2.0.json b/avalon/schema/version-2.0.json index f75f60cb6..086ee7d63 100644 --- a/avalon/schema/version-2.0.json +++ b/avalon/schema/version-2.0.json @@ -1,5 +1,5 @@ { - "$schema": "http://json-schema.org/schema#", + "$schema": "http://json-schema.org/draft-04/schema#", "title": "avalon-core:version-2.0", "description": "An individual version", From e97d4fb3a20c4b15ea9aaffbf4002c4e99f7e6fe Mon Sep 17 00:00:00 2001 From: David Lai Date: Mon, 21 Jan 2019 19:20:31 +0800 Subject: [PATCH 2/2] Change JSON schema validation keyword `const` to `enum` The validation keyword `const` was from Draft06, but the current `jsonschema` version in `avalon.vendor` is `2.4.0`, which only support to Draft04 validation, so `const` will not validate as expect. Changing to `enum` will fix this. --- avalon/schema/asset-2.0.json | 4 ++-- avalon/schema/container-1.0.json | 2 +- avalon/schema/container-2.0.json | 4 ++-- avalon/schema/project-2.0.json | 4 ++-- avalon/schema/representation-2.0.json | 4 ++-- avalon/schema/subset-2.0.json | 4 ++-- avalon/schema/version-2.0.json | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/avalon/schema/asset-2.0.json b/avalon/schema/asset-2.0.json index 9b859c4f2..8ea33feec 100644 --- a/avalon/schema/asset-2.0.json +++ b/avalon/schema/asset-2.0.json @@ -20,13 +20,13 @@ "schema": { "description": "Schema identifier for payload", "type": "string", - "const": "avalon-core:asset-2.0", + "enum": ["avalon-core:asset-2.0"], "example": "avalon-core:asset-2.0" }, "type": { "description": "The type of document", "type": "string", - "const": "asset", + "enum": ["asset"], "example": "asset" }, "parent": { diff --git a/avalon/schema/container-1.0.json b/avalon/schema/container-1.0.json index 411e814a4..bf6bac062 100644 --- a/avalon/schema/container-1.0.json +++ b/avalon/schema/container-1.0.json @@ -28,7 +28,7 @@ "id": { "description": "Identifier for finding object in host", "type": "string", - "const": "pyblish.mindbender.container", + "enum": ["pyblish.mindbender.container"], "example": "pyblish.mindbender.container" }, "objectName": { diff --git a/avalon/schema/container-2.0.json b/avalon/schema/container-2.0.json index c8fb2b551..dface2f1e 100644 --- a/avalon/schema/container-2.0.json +++ b/avalon/schema/container-2.0.json @@ -21,13 +21,13 @@ "schema": { "description": "Schema identifier for payload", "type": "string", - "const": "avalon-core:container-2.0", + "enum": ["avalon-core:container-2.0"], "example": "avalon-core:container-2.0" }, "id": { "description": "Identifier for finding object in host", "type": "string", - "const": "pyblish.avalon.container", + "enum": ["pyblish.avalon.container"], "example": "pyblish.avalon.container" }, "objectName": { diff --git a/avalon/schema/project-2.0.json b/avalon/schema/project-2.0.json index 93c74f85b..e0bbee47b 100644 --- a/avalon/schema/project-2.0.json +++ b/avalon/schema/project-2.0.json @@ -20,13 +20,13 @@ "schema": { "description": "Schema identifier for payload", "type": "string", - "const": "avalon-core:project-2.0", + "enum": ["avalon-core:project-2.0"], "example": "avalon-core:project-2.0" }, "type": { "description": "The type of document", "type": "string", - "const": "project", + "enum": ["project"], "example": "project" }, "parent": { diff --git a/avalon/schema/representation-2.0.json b/avalon/schema/representation-2.0.json index a824b567d..48b66f2be 100644 --- a/avalon/schema/representation-2.0.json +++ b/avalon/schema/representation-2.0.json @@ -20,13 +20,13 @@ "schema": { "description": "Schema identifier for payload", "type": "string", - "const": "avalon-core:representation-2.0", + "enum": ["avalon-core:representation-2.0"], "example": "avalon-core:representation-2.0" }, "type": { "description": "The type of document", "type": "string", - "const": "representation", + "enum": ["representation"], "example": "representation" }, "parent": { diff --git a/avalon/schema/subset-2.0.json b/avalon/schema/subset-2.0.json index 372b64df8..6f1d26cf0 100644 --- a/avalon/schema/subset-2.0.json +++ b/avalon/schema/subset-2.0.json @@ -20,13 +20,13 @@ "schema": { "description": "The schema associated with this document", "type": "string", - "const": "avalon-core:subset-2.0", + "enum": ["avalon-core:subset-2.0"], "example": "avalon-core:subset-2.0" }, "type": { "description": "The type of document", "type": "string", - "const": "subset", + "enum": ["subset"], "example": "subset" }, "parent": { diff --git a/avalon/schema/version-2.0.json b/avalon/schema/version-2.0.json index 086ee7d63..1218f5a72 100644 --- a/avalon/schema/version-2.0.json +++ b/avalon/schema/version-2.0.json @@ -20,13 +20,13 @@ "schema": { "description": "The schema associated with this document", "type": "string", - "const": "avalon-core:version-2.0", + "enum": ["avalon-core:version-2.0"], "example": "avalon-core:version-2.0" }, "type": { "description": "The type of document", "type": "string", - "const": "version", + "enum": ["version"], "example": "version" }, "parent": {