Merge 673f3fbf2dc539fd2874d172c97d3fd6055c992c into 2fb26c362ea6557c90353606ccdc3c446d6a8f35

This commit is contained in:
Bilal Tonga 2025-05-12 10:35:09 +09:00 committed by GitHub
commit 63c3363b63
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
185 changed files with 657 additions and 370 deletions

View File

@ -127,8 +127,15 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
{{#vendorExtensions.x-py-readonly}}
"{{{.}}}",
{{/vendorExtensions.x-py-readonly}}
{{#isAdditionalPropertiesTrue}}
"additional_properties",
{{/isAdditionalPropertiesTrue}}
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[{{^hasChildren}}Self{{/hasChildren}}{{#hasChildren}}{{#discriminator}}Union[{{#mappedModels}}{{{modelName}}}{{^-last}}, {{/-last}}{{/mappedModels}}]{{/discriminator}}{{^discriminator}}Self{{/discriminator}}{{/hasChildren}}]:

View File

@ -44,8 +44,9 @@ class Bird(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class Category(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -47,8 +47,9 @@ class DataQuery(Query):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -62,8 +62,9 @@ class DefaultValue(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -46,8 +46,9 @@ class NumberPropertiesOnly(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -60,8 +60,9 @@ class Pet(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -55,8 +55,9 @@ class Query(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class Tag(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class TestFormObjectMultipartRequestMarker(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -46,8 +46,9 @@ class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseMod
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class Bird(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class Category(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -47,8 +47,9 @@ class DataQuery(Query):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -62,8 +62,9 @@ class DefaultValue(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -46,8 +46,9 @@ class NumberPropertiesOnly(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -60,8 +60,9 @@ class Pet(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -55,8 +55,9 @@ class Query(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class Tag(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class TestFormObjectMultipartRequestMarker(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -46,8 +46,9 @@ class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter(BaseMod
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class TestQueryStyleFormExplodeTrueArrayStringQueryObjectParameter(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,10 @@ class AdditionalPropertiesAnyType(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
"additional_properties",
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class AdditionalPropertiesClass(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,10 @@ class AdditionalPropertiesObject(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
"additional_properties",
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,10 @@ class AdditionalPropertiesWithDescriptionOnly(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
"additional_properties",
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class AllOfSuperModel(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class AllOfWithSingleRef(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -66,8 +66,9 @@ class Animal(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Union[Cat, Dog]]:

View File

@ -43,8 +43,9 @@ class ArrayOfArrayOfModel(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class ArrayOfArrayOfNumberOnly(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class ArrayOfNumberOnly(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -47,8 +47,9 @@ class ArrayTest(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class BasquePig(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -58,8 +58,9 @@ class Bathing(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -47,8 +47,9 @@ class Capitalization(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class Cat(Animal):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class Category(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class CircularAllOfRef(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class CircularReferenceModel(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class ClassModel(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class Client(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -66,8 +66,9 @@ class Creature(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Union[HuntingDog]]:

View File

@ -42,8 +42,9 @@ class CreatureInfo(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class DanishPig(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class DeprecatedObject(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class DiscriminatorAllOfSub(DiscriminatorAllOfSuper):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -64,8 +64,9 @@ class DiscriminatorAllOfSuper(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Union[DiscriminatorAllOfSub]]:

View File

@ -43,8 +43,9 @@ class Dog(Animal):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class DummyModel(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -64,8 +64,9 @@ class EnumArrays(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -127,8 +127,9 @@ class EnumTest(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -58,8 +58,9 @@ class Feeding(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class File(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class FileSchemaTestClass(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class FirstRef(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class Foo(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class FooGetDefaultResponse(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -101,8 +101,9 @@ class FormatTest(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,11 @@ class HasOnlyReadOnly(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
"bar",
"foo",
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class HealthCheckResult(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class InnerDictWithProperty(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class InputAllOf(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class ListClass(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class MapOfArrayOfModel(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -56,8 +56,9 @@ class MapTest(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -46,8 +46,9 @@ class MixedPropertiesAndAdditionalPropertiesClass(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class Model200Response(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class ModelApiResponse(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class ModelField(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class ModelReturn(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -45,8 +45,11 @@ class Name(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
"snake_case",
"var_123_number",
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -56,8 +56,10 @@ class NullableClass(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
"additional_properties",
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -54,8 +54,9 @@ class NullableProperty(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class NumberOnly(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class ObjectToTestAdditionalProperties(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -46,8 +46,9 @@ class ObjectWithDeprecatedFields(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -58,8 +58,9 @@ class Order(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class OuterComposite(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -45,8 +45,9 @@ class OuterObjectWithEnumProperty(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class Parent(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class ParentWithOptionalDict(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -60,8 +60,9 @@ class Pet(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -58,8 +58,9 @@ class PoopCleaning(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class PropertyMap(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class PropertyNameCollision(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,10 @@ class ReadOnlyFirst(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
"bar",
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class SecondCircularAllOfRef(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class SecondRef(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class SelfReferenceModel(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class SpecialModelName(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -55,8 +55,9 @@ class SpecialName(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,9 @@ class Tag(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -44,8 +44,9 @@ class Task(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class TestErrorResponsesWithModel400Response(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class TestErrorResponsesWithModel404Response(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -43,8 +43,10 @@ class TestInlineFreeformAdditionalPropertiesRequest(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
"additional_properties",
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class TestObjectForMultipartRequestsRequestMarker(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

View File

@ -42,8 +42,9 @@ class Tiger(BaseModel):
def to_json(self) -> str:
"""Returns the JSON representation of the model using alias"""
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
return json.dumps(self.to_dict())
excluded_fields: Set[str] = set([
])
return self.model_dump_json(by_alias=True, exclude_unset=True, exclude=excluded_fields)
@classmethod
def from_json(cls, json_str: str) -> Optional[Self]:

Some files were not shown because too many files have changed in this diff Show More