mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-05-12 12:40:53 +00:00
Merge 673f3fbf2dc539fd2874d172c97d3fd6055c992c into 2fb26c362ea6557c90353606ccdc3c446d6a8f35
This commit is contained in:
commit
63c3363b63
@ -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}}]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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]:
|
||||
|
@ -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
Loading…
x
Reference in New Issue
Block a user