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

MAINT: renamed parameter in json_schema_exporter

parent cd9459b2
No related branches found
No related tags found
2 merge requests!89ENH: JsonSchemaExporter accepts do_not_create parameter.,!84F more jsonschema export
Pipeline #43330 failed
...@@ -36,8 +36,8 @@ class JsonSchemaExporter: ...@@ -36,8 +36,8 @@ class JsonSchemaExporter:
""" """
def __init__(self, additional_properties: bool = True, def __init__(self, additional_properties: bool = True,
name_for_new_reference_records: bool = False, name_property_for_new_records: bool = False,
description_for_new_reference_records: bool = False, description_property_for_new_records: bool = False,
additional_options_for_text_props: dict = None, additional_options_for_text_props: dict = None,
units_in_description: bool = True, units_in_description: bool = True,
do_not_create: List[str] = None, do_not_create: List[str] = None,
...@@ -51,12 +51,12 @@ class JsonSchemaExporter: ...@@ -51,12 +51,12 @@ class JsonSchemaExporter:
additional_properties : bool, optional additional_properties : bool, optional
Whether additional properties will be admitted in the resulting Whether additional properties will be admitted in the resulting
schema. Optional, default is True. schema. Optional, default is True.
name_for_new_reference_records : bool, optional name_property_for_new_records : bool, optional
Whether objects that are generated from reference properties shall have a `name` Whether objects shall generally have a `name` property in the generated schema.
property in the generated schema. Optional, default is False. Optional, default is False.
description_for_new_reference_records : bool, optional description_property_for_new_records : bool, optional
Whether objects that are generated from reference properties shall have a `description` Whether objects shall generally have a `description` property in the generated schema.
property in the generated schema. Optional, default is False. Optional, default is False.
additional_options_for_text_props : dict, optional additional_options_for_text_props : dict, optional
Dictionary containing additional "pattern" or "format" options for Dictionary containing additional "pattern" or "format" options for
string-typed properties. Optional, default is empty. string-typed properties. Optional, default is empty.
...@@ -84,8 +84,8 @@ class JsonSchemaExporter: ...@@ -84,8 +84,8 @@ class JsonSchemaExporter:
do_not_retrieve = [] do_not_retrieve = []
self._additional_properties = additional_properties self._additional_properties = additional_properties
self._name_for_new_reference_records = name_for_new_reference_records self._name_property_for_new_records = name_property_for_new_records
self._description_for_new_reference_records = description_for_new_reference_records self._description_property_for_new_records = description_property_for_new_records
self._additional_options_for_text_props = additional_options_for_text_props self._additional_options_for_text_props = additional_options_for_text_props
self._units_in_description = units_in_description self._units_in_description = units_in_description
self._do_not_create = do_not_create self._do_not_create = do_not_create
...@@ -256,9 +256,9 @@ class JsonSchemaExporter: ...@@ -256,9 +256,9 @@ class JsonSchemaExporter:
schema["additionalProperties"] = self._additional_properties schema["additionalProperties"] = self._additional_properties
props = OrderedDict() props = OrderedDict()
if self._name_for_new_reference_records: if self._name_property_for_new_records:
props["name"] = self._make_text_property("The name of the Record to be created") props["name"] = self._make_text_property("The name of the Record to be created")
if self._description_for_new_reference_records: if self._description_property_for_new_records:
props["description"] = self._make_text_property( props["description"] = self._make_text_property(
"The description of the Record to be created") "The description of the Record to be created")
...@@ -303,8 +303,8 @@ class JsonSchemaExporter: ...@@ -303,8 +303,8 @@ class JsonSchemaExporter:
def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = True, def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = True,
name_for_new_reference_records: bool = False, name_property_for_new_records: bool = False,
description_for_new_reference_records: bool = False, description_property_for_new_records: bool = False,
additional_options_for_text_props: Optional[dict] = None, additional_options_for_text_props: Optional[dict] = None,
units_in_description: bool = True, units_in_description: bool = True,
do_not_create: List[str] = None, do_not_create: List[str] = None,
...@@ -324,12 +324,12 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T ...@@ -324,12 +324,12 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T
additional_properties : bool, optional additional_properties : bool, optional
Whether additional properties will be admitted in the resulting Whether additional properties will be admitted in the resulting
schema. Optional, default is True. schema. Optional, default is True.
name_for_new_reference_records : bool, optional name_property_for_new_records : bool, optional
Whether objects that are generated from reference properties shall have a `name` Whether objects shall generally have a `name` property in the generated schema. Optional,
property in the generated schema. Optional, default is False. default is False.
description_for_new_reference_records : bool, optional description_property_for_new_records : bool, optional
Whether objects that are generated from reference properties shall have a `description` Whether objects shall generally have a `description` property in the generated schema.
property in the generated schema. Optional, default is False. Optional, default is False.
additional_options_for_text_props : dict, optional additional_options_for_text_props : dict, optional
Dictionary containing additional "pattern" or "format" options for Dictionary containing additional "pattern" or "format" options for
string-typed properties. Optional, default is empty. string-typed properties. Optional, default is empty.
...@@ -358,8 +358,8 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T ...@@ -358,8 +358,8 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T
exporter = JsonSchemaExporter( exporter = JsonSchemaExporter(
additional_properties=additional_properties, additional_properties=additional_properties,
name_for_new_reference_records=name_for_new_reference_records, name_property_for_new_records=name_property_for_new_records,
description_for_new_reference_records=description_for_new_reference_records, description_property_for_new_records=description_property_for_new_records,
additional_options_for_text_props=additional_options_for_text_props, additional_options_for_text_props=additional_options_for_text_props,
units_in_description=units_in_description, units_in_description=units_in_description,
do_not_create=do_not_create, do_not_create=do_not_create,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment