You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating the sdk like this: pnpm dlx @openapitools/openapi-generator-cli generate -i spec.yaml -g python -o /package --package-name my_package
It generates a Datetime pydantic model without any properties:
# coding: utf-8""" Foo No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually."""# noqa: E501from __future__ importannotationsimportpprintimportre# noqa: F401importjsonfrompydanticimportBaseModelclassDatetime(BaseModel):
""" Datetime """__properties= []
classConfig:
"""Pydantic configuration"""allow_population_by_field_name=Truevalidate_assignment=Truedefto_str(self) ->str:
"""Returns the string representation of the model using alias"""returnpprint.pformat(self.dict(by_alias=True))
defto_json(self) ->str:
"""Returns the JSON representation of the model using alias"""returnjson.dumps(self.to_dict())
@classmethoddeffrom_json(cls, json_str: str) ->Datetime:
"""Create an instance of Datetime from a JSON string"""returncls.from_dict(json.loads(json_str))
defto_dict(self):
"""Returns the dictionary representation of the model using alias"""_dict=self.dict(by_alias=True,
exclude={
},
exclude_none=True)
return_dict@classmethoddeffrom_dict(cls, obj: dict) ->Datetime:
"""Create an instance of Datetime from a dict"""ifobjisNone:
returnNoneifnotisinstance(obj, dict):
returnDatetime.parse_obj(obj)
_obj=Datetime.parse_obj({
})
return_obj
The text was updated successfully, but these errors were encountered:
Description
The generator seems to generate a pydantic model without any properties, thus is useless. See below for full example.
openapi-generator version
7.0.1
OpenAPI declaration file content or url
This is minimal schema that reproduces the issue. This schema comes from third party and is outside of my control, I cannot change it.
Generation Details
Generating the sdk like this:
pnpm dlx @openapitools/openapi-generator-cli generate -i spec.yaml -g python -o /package --package-name my_package
It generates a
Datetime
pydantic model without any properties:The text was updated successfully, but these errors were encountered: