From 08c34347f54d4b611a9d0ba1521491792bde167c Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Wed, 4 Sep 2024 07:23:11 +0200 Subject: [PATCH 1/3] Bump specs version to 1.0 --- schema/composition/animation.json | 2 +- schema/root.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/schema/composition/animation.json b/schema/composition/animation.json index 1e3c847..750b9e6 100644 --- a/schema/composition/animation.json +++ b/schema/composition/animation.json @@ -14,7 +14,7 @@ "title": "Specification Version", "description": "Specification version this Lottie is targeting. This is a 6 digit number with version components encoded as `MMmmpp`, with `MM` being major version, `mm` being minor and `pp` being patch.", "type": "integer", - "minimum": 100 + "minimum": 10000 }, "fr": { "title": "Framerate", diff --git a/schema/root.json b/schema/root.json index 01cf915..d85f092 100644 --- a/schema/root.json +++ b/schema/root.json @@ -1,6 +1,6 @@ { "$schema": "https://json-schema.org/draft/2020-12/schema", - "$id": "https://lottie.github.io/lottie-spec/specs/schema/0.1.0", + "$id": "https://lottie.github.io/lottie-spec/1.0/specs/schema/", "$ref": "#/$defs/composition/animation", - "$version": 100 + "$version": 1000000 } From 0427319fba5731ca64b1049f3590b1acdc52696d Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Wed, 4 Sep 2024 07:23:58 +0200 Subject: [PATCH 2/3] Too many 00 --- schema/root.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schema/root.json b/schema/root.json index d85f092..549dc29 100644 --- a/schema/root.json +++ b/schema/root.json @@ -2,5 +2,5 @@ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://lottie.github.io/lottie-spec/1.0/specs/schema/", "$ref": "#/$defs/composition/animation", - "$version": 1000000 + "$version": 10000 } From d3e19940d5adb97efb982e95f442722b622d10cc Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Wed, 4 Sep 2024 07:54:17 +0200 Subject: [PATCH 3/3] Allow version numbers without patch --- tools/schema-validate.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tools/schema-validate.py b/tools/schema-validate.py index 7e749da..d5f8f5b 100755 --- a/tools/schema-validate.py +++ b/tools/schema-validate.py @@ -70,16 +70,20 @@ def collect_defs(self, schema): self.collect_defs(child) def check_version(self, schema: Schema): - versionNumber = schema["$version"] + version_number = schema["$version"] - majorVersion = versionNumber // 10000 - minorVersion = (versionNumber % 10000) // 100 - patchVersion = versionNumber % 100 + major_version = version_number // 10000 + minor_version = (version_number % 10000) // 100 + patch_version = version_number % 100 - versionString = f'{majorVersion}.{minorVersion}.{patchVersion}' + components = [major_version, minor_version] + if patch_version != 0: + components.append(patch_version) - if versionString not in schema["$id"]: - self.error(schema, "Mismatched URI version - expected: %s" % versionString) + version_string = ".".join(map(str, components)) + + if version_string not in schema["$id"]: + self.error(schema, "Mismatched URI version - expected: %s" % version_string) def check_links(self, html_path: pathlib.Path): checked = set()