diff --git a/src/caosadvancedtools/json_schema_exporter.py b/src/caosadvancedtools/json_schema_exporter.py index fa26746ef6331af00c54b1302103e3a02b1b4ce9..700c24e890c36a5b4219a1c2cc7d74ce38d6d398 100644 --- a/src/caosadvancedtools/json_schema_exporter.py +++ b/src/caosadvancedtools/json_schema_exporter.py @@ -74,7 +74,7 @@ class JsonSchemaExporter: additional `unit` key is added to the schema itself which is purely annotational and ignored, e.g., in validation. Default is True. do_not_create : list[str] - A list of RedcordType names, for which there should be no option + A list of reference Property names, for which there should be no option to create them. Instead, only the choice of existing elements should be given. do_not_retrieve : list[str] @@ -194,9 +194,12 @@ class JsonSchemaExporter: name=prop.name, datatype=get_list_datatype(prop.datatype, strict=True)) json_prop["items"], inner_ui_schema = self._make_segment_from_prop(list_element_prop) if prop.name in self._multiple_choice and prop.name in self._do_not_create: + # TODO: if not multiple_choice, but do_not_create: + # "ui:widget" = "radio" & "ui:inline" = true + # TODO: set threshold for number of items. json_prop["uniqueItems"] = True ui_schema["ui:widget"] = "checkboxes" - ui_schema["ui:options"] = {"inline": True} + ui_schema["ui:inline"] = True if inner_ui_schema: ui_schema["items"] = inner_ui_schema elif prop.is_reference(): @@ -512,7 +515,7 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T additional `unit` key is added to the schema itself which is purely annotational and ignored, e.g., in validation. Default is True. do_not_create : list[str], optional - A list of RedcordType names, for which there should be no option + A list of reference Property names, for which there should be no option to create them. Instead, only the choice of existing elements should be given. do_not_retrieve : list[str], optional