From 6f04600e4488f3735f670a7c63b3654844ea30ac Mon Sep 17 00:00:00 2001 From: Max Tkachenko Date: Mon, 28 Oct 2024 14:51:58 +0000 Subject: [PATCH] fix: Update label_config_schema.json according to LS backend --- .../_legacy/schema/label_config_schema.json | 53 +++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/src/label_studio_sdk/_legacy/schema/label_config_schema.json b/src/label_studio_sdk/_legacy/schema/label_config_schema.json index a8daa044..f8776af3 100644 --- a/src/label_studio_sdk/_legacy/schema/label_config_schema.json +++ b/src/label_studio_sdk/_legacy/schema/label_config_schema.json @@ -35,22 +35,44 @@ } } }, - "tag_with_value_required_name": { + "tag_with_name_and_toname": { "type": "object", - "anyOf": [ - { - "required": [ - "@name", - "@valueList" - ] - }, + "oneOf": [ { "required": [ "@name", - "@value" + "@toName" ] } ], + "properties": { + "@name": { + "$ref": "#/definitions/@name" + }, + "@toName": { + "$ref": "#/definitions/@toName" + }, + "$": { + "$ref": "#/definitions/$" + } + } + }, + "tag_with_value_required_name": { + "type": "object", + "oneOf": [ + { + "required": [ + "@name", + "@value" + ] + }, + { + "required": [ + "@name", + "@valueList" + ] + } + ], "properties": { "@value": { "$ref": "#/definitions/@value" @@ -80,6 +102,13 @@ "items": {"$ref": "#/definitions/tag_with_value_required_name"} }, {"$ref": "#/definitions/tag_with_value_required_name"}] }, + "tags_with_name_and_toname": { + "anyOf": [{"$ref": "#/definitions/tag_with_name_and_toname"}, + { + "type": "array", + "items": {"$ref": "#/definitions/tag_with_name_and_toname"} + }] + }, "View": { "type": "object", "additionalProperties": true, @@ -92,7 +121,8 @@ "Text": {"$ref": "#/definitions/tags_with_value_required_name"}, "HyperText": {"$ref": "#/definitions/tags_with_value_required_name"}, "View": {"$ref": "#/definitions/MaybeMultipleView"}, - "TextArea": {"$ref": "#/definitions/MaybeMultipleTextAreas"} + "TextArea": {"$ref": "#/definitions/MaybeMultipleTextAreas"}, + "Number": {"$ref": "#/definitions/tags_with_name_and_toname"} } }, "MaybeMultipleView": { @@ -219,7 +249,8 @@ "Image": {"$ref": "#/definitions/tags_with_value_required_name"}, "Text": {"$ref": "#/definitions/tags_with_value_required_name"}, "HyperText": {"$ref": "#/definitions/tags_with_value_required_name"}, - "TextArea": {"$ref": "#/definitions/MaybeMultipleTextAreas"} + "TextArea": {"$ref": "#/definitions/MaybeMultipleTextAreas"}, + "Number": {"$ref": "#/definitions/tags_with_name_and_toname"} } } }