Skip to content
Snippets Groups Projects
Verified Commit d2f22ac3 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

ENH: Using OrderedDict for dictionaries of properties.

parent 0af91939
No related branches found
No related tags found
2 merge requests!89ENH: JsonSchemaExporter accepts do_not_create parameter.,!83ENH: JsonSchemaExporter can merge schemata and arrayize them
......@@ -23,6 +23,7 @@
"""
from typing import Any, List, Optional
from collections import OrderedDict
import linkahead as db
from linkahead.common.datatype import get_list_datatype, is_list_datatype
......@@ -113,7 +114,7 @@ class JsonSchemaExporter:
return self._make_text_property(prop.description, text_format, text_pattern)
json_prop = {}
json_prop = OrderedDict()
if prop.description:
json_prop["description"] = prop.description
if self._units_in_description and prop.unit:
......@@ -224,7 +225,7 @@ class JsonSchemaExporter:
schema["required"] = self._make_required_list(rt)
schema["additionalProperties"] = self._additional_properties
props = {}
props = OrderedDict()
if self._name_and_description_in_properties:
props["name"] = self._make_text_property("The name of the Record to be created")
props["description"] = self._make_text_property(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment