Skip to content
Snippets Groups Projects

F schema export references

Merged Florian Spreckelsen requested to merge f-schema-export-references into dev
All threads resolved!
2 files
+ 27
5
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -58,6 +58,8 @@ def _make_prop_from_prop(prop: db.Property, additional_properties: bool,
instead.
"""
if not additional_options_for_text_props:
additional_options_for_text_props = {}
if prop.datatype == db.TEXT or prop.datatype == db.DATETIME:
text_format = None
text_pattern = None
@@ -139,7 +141,19 @@ def _make_text_property(description="", text_format=None, text_pattern=None):
prop["description"] = description
if text_format is not None:
if isinstance(text_format, list):
prop["anyOf"] = [{"format": tf} for tf in text_format]
# We want the type inside the options, not in the head:
# "datetime property": {
# "anyOf": [
# {
# "type": "string",
# "format": "date"
# },
# {
# "type": "string",
# "format": "date-time"
# }]}
prop.pop("type")
prop["anyOf"] = [{"type": "string", "format": tf} for tf in text_format]
else:
prop["format"] = text_format
if text_pattern is not None:
Loading