Skip to content

Commit 370515e

Browse files
committed
clean up
1 parent ad72128 commit 370515e

383 files changed

Lines changed: 410 additions & 410 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/openapi-generator/src/main/resources/python/model_generic.mustache

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ from pydantic import Field
1616
{{! If this model is a super class, importlib is used. So import the necessary modules for the type here. }}
1717
from typing import TYPE_CHECKING
1818
if TYPE_CHECKING:
19-
{{#mappedModels}}
20-
from {{packageName}}.models.{{model.classFilename}} import {{modelName}}
21-
{{/mappedModels}}
19+
{{#mappedModels}}
20+
from {{packageName}}.models.{{model.classFilename}} import {{modelName}}
21+
{{/mappedModels}}
2222

2323
{{/discriminator}}
2424
{{/hasChildren}}
@@ -166,7 +166,7 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
166166

167167
def to_json(self) -> str:
168168
"""Returns the JSON representation of the actual instance"""
169-
return self.model_dump_json(by_alias=True)
169+
return json.dumps(self.model_dump(by_alias=True))
170170

171171
def to_dict(self) -> Dict[str, Any]:
172172
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/bird.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def from_json(cls, json_str: str) -> Self:
4949

5050
def to_json(self) -> str:
5151
"""Returns the JSON representation of the actual instance"""
52-
return self.model_dump_json(by_alias=True)
52+
return json.dumps(self.model_dump(by_alias=True))
5353

5454
def to_dict(self) -> Dict[str, Any]:
5555
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/category.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def from_json(cls, json_str: str) -> Self:
4949

5050
def to_json(self) -> str:
5151
"""Returns the JSON representation of the actual instance"""
52-
return self.model_dump_json(by_alias=True)
52+
return json.dumps(self.model_dump(by_alias=True))
5353

5454
def to_dict(self) -> Dict[str, Any]:
5555
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/data_query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def from_json(cls, json_str: str) -> Self:
5252

5353
def to_json(self) -> str:
5454
"""Returns the JSON representation of the actual instance"""
55-
return self.model_dump_json(by_alias=True)
55+
return json.dumps(self.model_dump(by_alias=True))
5656

5757
def to_dict(self) -> Dict[str, Any]:
5858
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/default_value.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def from_json(cls, json_str: str) -> Self:
7070

7171
def to_json(self) -> str:
7272
"""Returns the JSON representation of the actual instance"""
73-
return self.model_dump_json(by_alias=True)
73+
return json.dumps(self.model_dump(by_alias=True))
7474

7575
def to_dict(self) -> Dict[str, Any]:
7676
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/number_properties_only.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def from_json(cls, json_str: str) -> Self:
5151

5252
def to_json(self) -> str:
5353
"""Returns the JSON representation of the actual instance"""
54-
return self.model_dump_json(by_alias=True)
54+
return json.dumps(self.model_dump(by_alias=True))
5555

5656
def to_dict(self) -> Dict[str, Any]:
5757
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/pet.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def from_json(cls, json_str: str) -> Self:
6868

6969
def to_json(self) -> str:
7070
"""Returns the JSON representation of the actual instance"""
71-
return self.model_dump_json(by_alias=True)
71+
return json.dumps(self.model_dump(by_alias=True))
7272

7373
def to_dict(self) -> Dict[str, Any]:
7474
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/query.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def from_json(cls, json_str: str) -> Self:
6363

6464
def to_json(self) -> str:
6565
"""Returns the JSON representation of the actual instance"""
66-
return self.model_dump_json(by_alias=True)
66+
return json.dumps(self.model_dump(by_alias=True))
6767

6868
def to_dict(self) -> Dict[str, Any]:
6969
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/tag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def from_json(cls, json_str: str) -> Self:
4949

5050
def to_json(self) -> str:
5151
"""Returns the JSON representation of the actual instance"""
52-
return self.model_dump_json(by_alias=True)
52+
return json.dumps(self.model_dump(by_alias=True))
5353

5454
def to_dict(self) -> Dict[str, Any]:
5555
"""Returns the dict representation of the actual instance"""

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/models/test_form_object_multipart_request_marker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def from_json(cls, json_str: str) -> Self:
4848

4949
def to_json(self) -> str:
5050
"""Returns the JSON representation of the actual instance"""
51-
return self.model_dump_json(by_alias=True)
51+
return json.dumps(self.model_dump(by_alias=True))
5252

5353
def to_dict(self) -> Dict[str, Any]:
5454
"""Returns the dict representation of the actual instance"""

0 commit comments

Comments
 (0)