Open fuzihaofzh opened 2 years ago
Describe the bug When I put one HyperText block. Everything works fine. However, when I use two HyperText, it failed to render.
<View > <HyperText name="span" inline="true" clickableLinks="true"> <p>aaaa</p> </HyperText> <HyperText name="p" inline="true" clickableLinks="true"> <p>bbbb</p> </HyperText> </View>
The corresponding error is:
sequence item 0: expected str instance, int found b041ba22-f17e-46ce-b024-981449c00f87
Problem on the backend side
Traceback:
{noformat}{id: "9122cec1-9079-44f3-af55-a3f62589d145", status_code: 500, version: "1.4.1post1",…} detail: "sequence item 0: expected str instance, int found" exc_info: "Traceback (most recent call last):\n File \"/mnt/Projects/heartex/label-studio/label_studio/core/label_config.py\", line 89, in validate_label_config\n jsonschema.validate(config, _LABEL_CONFIG_SCHEMA_DATA)\n File \"/mnt/Projects/heartex/label-studio/env3/lib/python3.9/site-packages/jsonschema/validators.py\", line 934, in validate\n raise error\njsonschema.exceptions.ValidationError: '@value' is a required property\n\nFailed validating 'required' in schema[0]['items']:\n {'properties': {'$': {'$ref': '#/definitions/$'},\n '@value': {'$ref': '#/definitions/@value'}},\n 'required': ['@value'],\n 'type': 'object'}\n\nOn instance[0]:\n OrderedDict([('@name', 'text'), ('b', OrderedDict([('$', 'test1')]))])\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/mnt/Projects/heartex/label-studio/env3/lib/python3.9/site-packages/rest_framework/views.py\", line 506, in dispatch\n response = handler(request, *args, *kwargs)\n File \"/mnt/Projects/heartex/label-studio/env3/lib/python3.9/site-packages/django/utils/decorators.py\", line 43, in _wrapper\n return bound_method(args, **kwargs)\n File \"/mnt/Projects/heartex/label-studio/label_studio/projects/api.py\", line 324, in post\n project.validate_config(label_config, strict=True)\n File \"/mnt/Projects/heartex/label-studio/label_studio/projects/models.py\", line 457, in validate_config\n self.validate_label_config(config_string)\n File \"/mnt/Projects/heartex/label-studio/label_studio/projects/models.py\", line 454, in validate_label_config\n validate_label_config(config_string)\n File \"/mnt/Projects/heartex/label-studio/label_studio/core/label_config.py\", line 94, in validate_label_config\n error_message = 'Validation failed on {}: {}'.format('/'.join(exc.path), error_message.replace('@', ''))\nTypeError: sequence item 0: expected str instance, int found\n" id: "9122cec1-9079-44f3-af55-a3f62589d145" status_code: 500 version: "1.4.1post1"{noformat}
@fuzihaofzh Thank you for your report, looks like a bug. I've created a jira ticket, hope it will be fixed soon.
Describe the bug When I put one HyperText block. Everything works fine. However, when I use two HyperText, it failed to render.
The corresponding error is:
Problem on the backend side
Traceback:
{noformat}{id: "9122cec1-9079-44f3-af55-a3f62589d145", status_code: 500, version: "1.4.1post1",…} detail: "sequence item 0: expected str instance, int found" exc_info: "Traceback (most recent call last):\n File \"/mnt/Projects/heartex/label-studio/label_studio/core/label_config.py\", line 89, in validate_label_config\n jsonschema.validate(config, _LABEL_CONFIG_SCHEMA_DATA)\n File \"/mnt/Projects/heartex/label-studio/env3/lib/python3.9/site-packages/jsonschema/validators.py\", line 934, in validate\n raise error\njsonschema.exceptions.ValidationError: '@value' is a required property\n\nFailed validating 'required' in schema[0]['items']:\n {'properties': {'$': {'$ref': '#/definitions/$'},\n '@value': {'$ref': '#/definitions/@value'}},\n 'required': ['@value'],\n 'type': 'object'}\n\nOn instance[0]:\n OrderedDict([('@name', 'text'), ('b', OrderedDict([('$', 'test1')]))])\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File \"/mnt/Projects/heartex/label-studio/env3/lib/python3.9/site-packages/rest_framework/views.py\", line 506, in dispatch\n response = handler(request, *args, *kwargs)\n File \"/mnt/Projects/heartex/label-studio/env3/lib/python3.9/site-packages/django/utils/decorators.py\", line 43, in _wrapper\n return bound_method(args, **kwargs)\n File \"/mnt/Projects/heartex/label-studio/label_studio/projects/api.py\", line 324, in post\n project.validate_config(label_config, strict=True)\n File \"/mnt/Projects/heartex/label-studio/label_studio/projects/models.py\", line 457, in validate_config\n self.validate_label_config(config_string)\n File \"/mnt/Projects/heartex/label-studio/label_studio/projects/models.py\", line 454, in validate_label_config\n validate_label_config(config_string)\n File \"/mnt/Projects/heartex/label-studio/label_studio/core/label_config.py\", line 94, in validate_label_config\n error_message = 'Validation failed on {}: {}'.format('/'.join(exc.path), error_message.replace('@', ''))\nTypeError: sequence item 0: expected str instance, int found\n" id: "9122cec1-9079-44f3-af55-a3f62589d145" status_code: 500 version: "1.4.1post1"{noformat}