From 90570a206796a06bd0320f8d8910b3b08c444d74 Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Fri, 24 Nov 2023 15:08:21 +0100 Subject: [PATCH] DOC: jsex: Better docstring, a few new TODOs --- src/caosadvancedtools/json_schema_exporter.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/caosadvancedtools/json_schema_exporter.py b/src/caosadvancedtools/json_schema_exporter.py index fa26746e..700c24e8 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 -- GitLab