From d5b294103ccbf1e5dbcabc5ecfc4fd2c43d524d7 Mon Sep 17 00:00:00 2001 From: Jonas Lagoni Date: Thu, 14 Mar 2024 11:24:11 +0100 Subject: [PATCH] commit snapshots --- .../__snapshots__/index.spec.ts.snap | 16 ++++++++-------- .../__snapshots__/index.spec.ts.snap | 2 +- .../__snapshots__/index.spec.ts.snap | 4 ++-- .../__snapshots__/PythonGenerator.spec.ts.snap | 12 ++++++------ .../__snapshots__/JsonSerializer.spec.ts.snap | 4 ++-- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/examples/generate-python-complete-models/__snapshots__/index.spec.ts.snap b/examples/generate-python-complete-models/__snapshots__/index.spec.ts.snap index b65fc34153..6dc7a78ecf 100644 --- a/examples/generate-python-complete-models/__snapshots__/index.spec.ts.snap +++ b/examples/generate-python-complete-models/__snapshots__/index.spec.ts.snap @@ -6,9 +6,9 @@ Array [ from typing import Any, Dict class ObjProperty: def __init__(self, input: Dict): - if hasattr(input, 'number'): + if 'number' in input: self._number: float = input['number'] - if hasattr(input, 'additional_properties'): + if 'additional_properties' in input: self._additional_properties: dict[str, Any] = input['additional_properties'] @property @@ -34,9 +34,9 @@ Array [ from typing import Any, Dict class ObjProperty: def __init__(self, input: Dict): - if hasattr(input, 'number'): + if 'number' in input: self._number: float = input['number'] - if hasattr(input, 'additional_properties'): + if 'additional_properties' in input: self._additional_properties: dict[str, Any] = input['additional_properties'] @property @@ -62,9 +62,9 @@ Array [ from typing import Any, Dict class Root: def __init__(self, input: Dict): - if hasattr(input, 'email'): + if 'email' in input: self._email: str = input['email'] - if hasattr(input, 'obj_property'): + if 'obj_property' in input: self._obj_property: ObjProperty = ObjProperty(input['obj_property']) @property @@ -90,9 +90,9 @@ Array [ from typing import Any, Dict class Root: def __init__(self, input: Dict): - if hasattr(input, 'email'): + if 'email' in input: self._email: str = input['email'] - if hasattr(input, 'obj_property'): + if 'obj_property' in input: self._obj_property: ObjProperty = ObjProperty(input['obj_property']) @property diff --git a/examples/generate-python-models/__snapshots__/index.spec.ts.snap b/examples/generate-python-models/__snapshots__/index.spec.ts.snap index d417a91f92..bf629a654a 100644 --- a/examples/generate-python-models/__snapshots__/index.spec.ts.snap +++ b/examples/generate-python-models/__snapshots__/index.spec.ts.snap @@ -4,7 +4,7 @@ exports[`Should be able to render python models and should log expected output t Array [ "class Root: def __init__(self, input: Dict): - if hasattr(input, 'email'): + if 'email' in input: self._email: str = input['email'] @property diff --git a/examples/python-generate-json-serializer-and-deserializer/__snapshots__/index.spec.ts.snap b/examples/python-generate-json-serializer-and-deserializer/__snapshots__/index.spec.ts.snap index 30113f1a8f..a64ad85d29 100644 --- a/examples/python-generate-json-serializer-and-deserializer/__snapshots__/index.spec.ts.snap +++ b/examples/python-generate-json-serializer-and-deserializer/__snapshots__/index.spec.ts.snap @@ -4,9 +4,9 @@ exports[`Should be able to render JSON serialization and deserialization functio Array [ "class Root: def __init__(self, input: Dict): - if hasattr(input, 'email'): + if 'email' in input: self._email: str = input['email'] - if hasattr(input, 'additional_properties'): + if 'additional_properties' in input: self._additional_properties: dict[str, Any] = input['additional_properties'] @property diff --git a/test/generators/python/__snapshots__/PythonGenerator.spec.ts.snap b/test/generators/python/__snapshots__/PythonGenerator.spec.ts.snap index 4dbdb9d671..545f57d6a4 100644 --- a/test/generators/python/__snapshots__/PythonGenerator.spec.ts.snap +++ b/test/generators/python/__snapshots__/PythonGenerator.spec.ts.snap @@ -54,7 +54,7 @@ exports[`PythonGenerator Class should handle self reference models 1`] = ` exports[`PythonGenerator Class should not render reserved keyword 1`] = ` "class Address: def __init__(self, input: Dict): - if hasattr(input, 'reserved_del'): + if 'reserved_del' in input: self._reserved_del: str = input['reserved_del'] @property @@ -73,12 +73,12 @@ exports[`PythonGenerator Class should render \`class\` type 1`] = ` self._city: str = input['city'] self._state: str = input['state'] self._house_number: float = input['house_number'] - if hasattr(input, 'marriage'): + if 'marriage' in input: self._marriage: bool = input['marriage'] - if hasattr(input, 'members'): + if 'members' in input: self._members: str | float | bool = input['members'] self._array_type: List[str | float | Any] = input['array_type'] - if hasattr(input, 'additional_properties'): + if 'additional_properties' in input: self._additional_properties: dict[str, Any | str] = input['additional_properties'] @property @@ -158,9 +158,9 @@ exports[`PythonGenerator Class should work with custom preset for \`class\` type def __init__(self, input: Dict): - if hasattr(input, 'property'): + if 'property' in input: self._property: str = input['property'] - if hasattr(input, 'additional_properties'): + if 'additional_properties' in input: self._additional_properties: dict[str, Any] = input['additional_properties'] test2 diff --git a/test/generators/python/presets/__snapshots__/JsonSerializer.spec.ts.snap b/test/generators/python/presets/__snapshots__/JsonSerializer.spec.ts.snap index b337ade90b..e71260fa49 100644 --- a/test/generators/python/presets/__snapshots__/JsonSerializer.spec.ts.snap +++ b/test/generators/python/presets/__snapshots__/JsonSerializer.spec.ts.snap @@ -3,9 +3,9 @@ exports[`PYTHON_JSON_SERIALIZER_PRESET should render serializer and deserializer for class 1`] = ` "class Test: def __init__(self, input: Dict): - if hasattr(input, 'prop'): + if 'prop' in input: self._prop: str = input['prop'] - if hasattr(input, 'additional_properties'): + if 'additional_properties' in input: self._additional_properties: dict[str, Any] = input['additional_properties'] @property