Skip to content
Snippets Groups Projects

jsex / yaml parser

Merged Daniel Hornung requested to merge f-more-jsonschema-export into dev
All threads resolved!
1 file
+ 6
3
Compare changes
  • Side-by-side
  • Inline
@@ -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
Loading