Skip to content

Commit 8e1ed42

Browse files
committed
upd samples
1 parent fd1099c commit 8e1ed42

98 files changed

Lines changed: 201 additions & 98 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.

samples/client/echo_api/python-disallowAdditionalPropertiesIfNotPresent/openapi_client/api_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ def __enter__(self):
9898
return self
9999

100100
def __exit__(self, exc_type, exc_value, traceback):
101-
pass
101+
self.close()
102+
103+
def close(self):
104+
self.rest_client.close()
102105

103106
@property
104107
def user_agent(self):

samples/client/echo_api/python/openapi_client/api_client.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ def __enter__(self):
9898
return self
9999

100100
def __exit__(self, exc_type, exc_value, traceback):
101-
pass
101+
self.close()
102+
103+
def close(self):
104+
self.rest_client.close()
102105

103106
@property
104107
def user_agent(self):

samples/openapi3/client/petstore/python-httpx-sync/petstore_api/models/additional_properties_any_type.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class AdditionalPropertiesAnyType(BaseModel):
3131
__properties: ClassVar[List[str]] = ["name"]
3232

3333
model_config = ConfigDict(
34-
populate_by_name=True,
34+
validate_by_name=True,
35+
validate_by_alias=True,
3536
validate_assignment=True,
3637
protected_namespaces=(),
3738
)

samples/openapi3/client/petstore/python-httpx-sync/petstore_api/models/additional_properties_class.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class AdditionalPropertiesClass(BaseModel):
3131
__properties: ClassVar[List[str]] = ["map_property", "map_of_map_property"]
3232

3333
model_config = ConfigDict(
34-
populate_by_name=True,
34+
validate_by_name=True,
35+
validate_by_alias=True,
3536
validate_assignment=True,
3637
protected_namespaces=(),
3738
)

samples/openapi3/client/petstore/python-httpx-sync/petstore_api/models/additional_properties_object.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class AdditionalPropertiesObject(BaseModel):
3131
__properties: ClassVar[List[str]] = ["name"]
3232

3333
model_config = ConfigDict(
34-
populate_by_name=True,
34+
validate_by_name=True,
35+
validate_by_alias=True,
3536
validate_assignment=True,
3637
protected_namespaces=(),
3738
)

samples/openapi3/client/petstore/python-httpx-sync/petstore_api/models/additional_properties_with_description_only.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class AdditionalPropertiesWithDescriptionOnly(BaseModel):
3131
__properties: ClassVar[List[str]] = ["name"]
3232

3333
model_config = ConfigDict(
34-
populate_by_name=True,
34+
validate_by_name=True,
35+
validate_by_alias=True,
3536
validate_assignment=True,
3637
protected_namespaces=(),
3738
)

samples/openapi3/client/petstore/python-httpx-sync/petstore_api/models/all_of_super_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ class AllOfSuperModel(BaseModel):
3030
__properties: ClassVar[List[str]] = ["_name"]
3131

3232
model_config = ConfigDict(
33-
populate_by_name=True,
33+
validate_by_name=True,
34+
validate_by_alias=True,
3435
validate_assignment=True,
3536
protected_namespaces=(),
3637
)

samples/openapi3/client/petstore/python-httpx-sync/petstore_api/models/all_of_with_single_ref.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ class AllOfWithSingleRef(BaseModel):
3232
__properties: ClassVar[List[str]] = ["username", "SingleRefType"]
3333

3434
model_config = ConfigDict(
35-
populate_by_name=True,
35+
validate_by_name=True,
36+
validate_by_alias=True,
3637
validate_assignment=True,
3738
protected_namespaces=(),
3839
)

samples/openapi3/client/petstore/python-httpx-sync/petstore_api/models/animal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ class Animal(BaseModel):
3737
__properties: ClassVar[List[str]] = ["className", "color"]
3838

3939
model_config = ConfigDict(
40-
populate_by_name=True,
40+
validate_by_name=True,
41+
validate_by_alias=True,
4142
validate_assignment=True,
4243
protected_namespaces=(),
4344
)

samples/openapi3/client/petstore/python-httpx-sync/petstore_api/models/array_of_array_of_model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ class ArrayOfArrayOfModel(BaseModel):
3131
__properties: ClassVar[List[str]] = ["another_property"]
3232

3333
model_config = ConfigDict(
34-
populate_by_name=True,
34+
validate_by_name=True,
35+
validate_by_alias=True,
3536
validate_assignment=True,
3637
protected_namespaces=(),
3738
)

0 commit comments

Comments
 (0)