From 884e9a551118c24f8f522a285be7a11bf3b07257 Mon Sep 17 00:00:00 2001 From: Daniel <d.hornung@indiscale.com> Date: Mon, 6 Nov 2023 16:26:25 +0100 Subject: [PATCH] MAINT: renamed parameter in json_schema_exporter --- src/caosadvancedtools/json_schema_exporter.py | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/caosadvancedtools/json_schema_exporter.py b/src/caosadvancedtools/json_schema_exporter.py index 4c06d6ff..f950b06f 100644 --- a/src/caosadvancedtools/json_schema_exporter.py +++ b/src/caosadvancedtools/json_schema_exporter.py @@ -36,8 +36,8 @@ class JsonSchemaExporter: """ def __init__(self, additional_properties: bool = True, - name_for_new_reference_records: bool = False, - description_for_new_reference_records: bool = False, + name_property_for_new_records: bool = False, + description_property_for_new_records: bool = False, additional_options_for_text_props: dict = None, units_in_description: bool = True, do_not_create: List[str] = None, @@ -51,12 +51,12 @@ class JsonSchemaExporter: additional_properties : bool, optional Whether additional properties will be admitted in the resulting schema. Optional, default is True. - name_for_new_reference_records : bool, optional - Whether objects that are generated from reference properties shall have a `name` - property in the generated schema. Optional, default is False. - description_for_new_reference_records : bool, optional - Whether objects that are generated from reference properties shall have a `description` - property in the generated schema. Optional, default is False. + name_property_for_new_records : bool, optional + Whether objects shall generally have a `name` property in the generated schema. + Optional, default is False. + description_property_for_new_records : bool, optional + Whether objects shall generally have a `description` property in the generated schema. + Optional, default is False. additional_options_for_text_props : dict, optional Dictionary containing additional "pattern" or "format" options for string-typed properties. Optional, default is empty. @@ -84,8 +84,8 @@ class JsonSchemaExporter: do_not_retrieve = [] self._additional_properties = additional_properties - self._name_for_new_reference_records = name_for_new_reference_records - self._description_for_new_reference_records = description_for_new_reference_records + self._name_property_for_new_records = name_property_for_new_records + self._description_property_for_new_records = description_property_for_new_records self._additional_options_for_text_props = additional_options_for_text_props self._units_in_description = units_in_description self._do_not_create = do_not_create @@ -256,9 +256,9 @@ class JsonSchemaExporter: schema["additionalProperties"] = self._additional_properties 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") - if self._description_for_new_reference_records: + if self._description_property_for_new_records: props["description"] = self._make_text_property( "The description of the Record to be created") @@ -303,8 +303,8 @@ class JsonSchemaExporter: def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = True, - name_for_new_reference_records: bool = False, - description_for_new_reference_records: bool = False, + name_property_for_new_records: bool = False, + description_property_for_new_records: bool = False, additional_options_for_text_props: Optional[dict] = None, units_in_description: bool = True, do_not_create: List[str] = None, @@ -324,12 +324,12 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T additional_properties : bool, optional Whether additional properties will be admitted in the resulting schema. Optional, default is True. - name_for_new_reference_records : bool, optional - Whether objects that are generated from reference properties shall have a `name` - property in the generated schema. Optional, default is False. - description_for_new_reference_records : bool, optional - Whether objects that are generated from reference properties shall have a `description` - property in the generated schema. Optional, default is False. + name_property_for_new_records : bool, optional + Whether objects shall generally have a `name` property in the generated schema. Optional, + default is False. + description_property_for_new_records : bool, optional + Whether objects shall generally have a `description` property in the generated schema. + Optional, default is False. additional_options_for_text_props : dict, optional Dictionary containing additional "pattern" or "format" options for string-typed properties. Optional, default is empty. @@ -358,8 +358,8 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T exporter = JsonSchemaExporter( additional_properties=additional_properties, - name_for_new_reference_records=name_for_new_reference_records, - description_for_new_reference_records=description_for_new_reference_records, + name_property_for_new_records=name_property_for_new_records, + description_property_for_new_records=description_property_for_new_records, additional_options_for_text_props=additional_options_for_text_props, units_in_description=units_in_description, do_not_create=do_not_create, -- GitLab