From ad6cebeef8ec56053b1ca1f757c2584c680e909d Mon Sep 17 00:00:00 2001 From: Hu Yueh-Wei Date: Thu, 26 Sep 2024 11:51:10 +0800 Subject: [PATCH] refactor!: restrict addon name to valid programming variable name (#49) --- .../src/json_schema/data/manifest.schema.json | 4 +-- .../src/json_schema/data/property.schema.json | 33 +++---------------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/core/src/ten_rust/src/json_schema/data/manifest.schema.json b/core/src/ten_rust/src/json_schema/data/manifest.schema.json index b105ea59f6..521ea28539 100644 --- a/core/src/ten_rust/src/json_schema/data/manifest.schema.json +++ b/core/src/ten_rust/src/json_schema/data/manifest.schema.json @@ -81,7 +81,7 @@ "$ref": "#/$defs/packageType" }, "name": { - "$ref": "#/$defs/notEmptyString" + "$ref": "#/$defs/alphanumericCharacters" }, "version": { "$ref": "#/$defs/versionRequirement" @@ -383,7 +383,7 @@ "$ref": "#/$defs/packageType" }, "name": { - "$ref": "#/$defs/notEmptyString" + "$ref": "#/$defs/alphanumericCharacters" }, "version": { "$ref": "#/$defs/version" diff --git a/core/src/ten_rust/src/json_schema/data/property.schema.json b/core/src/ten_rust/src/json_schema/data/property.schema.json index dc1403450c..d774260cfb 100644 --- a/core/src/ten_rust/src/json_schema/data/property.schema.json +++ b/core/src/ten_rust/src/json_schema/data/property.schema.json @@ -88,10 +88,10 @@ "$ref": "#/$defs/notEmptyString" }, "extension_group": { - "$ref": "#/$defs/addonInstance" + "$ref": "#/$defs/notEmptyString" }, "extension": { - "$ref": "#/$defs/addonInstance" + "$ref": "#/$defs/notEmptyString" }, "msg_conversion": { "type": "object", @@ -165,10 +165,10 @@ "$ref": "#/$defs/notEmptyString" }, "extension_group": { - "$ref": "#/$defs/addonInstance" + "$ref": "#/$defs/notEmptyString" }, "extension": { - "$ref": "#/$defs/addonInstance" + "$ref": "#/$defs/notEmptyString" }, "msg_conversion": { "$ref": "#/$defs/msgConversion" @@ -194,7 +194,7 @@ "$ref": "#/$defs/notEmptyString" }, "addon": { - "$ref": "#/$defs/notEmptyString" + "$ref": "#/$defs/alphanumericCharacters" }, "app": { "$ref": "#/$defs/notEmptyString" @@ -376,29 +376,6 @@ "$ref": "#/$defs/dataDest" } }, - "addonInstance": { - "oneOf": [ - { - "$ref": "#/$defs/notEmptyString" - }, - { - "type": "object", - "additionalProperties": false, - "required": [ - "addon", - "name" - ], - "properties": { - "addon": { - "$ref": "#/$defs/notEmptyString" - }, - "name": { - "$ref": "#/$defs/notEmptyString" - } - } - } - ] - }, "validPropertyObject": { "type": "object", "propertyNames": { // The property name should be alphanumericCharacters.