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
Is your feature request related to a problem? Please describe.
I want to be able to extend a model generated by this project in my business logic. A basic example would be:
# GeneratedModel generated by openapi-python-clientclassEnhancedGeneratedModel(GeneratedModel):
defid_eq(self, other: GeneratedModel) ->bool:
returnself.id==other.id
I cannot use EnhancedGeneratedModel.from_dict as that would return a GeneratedModel.
Describe the solution you'd like
Update the from_dict template in openapi_python_client/templates/model.pyi to be a @classmethod instead of a @staticmethod and use the passed class object to instantiate the model.
Is your feature request related to a problem? Please describe.
I want to be able to extend a model generated by this project in my business logic. A basic example would be:
I cannot use
EnhancedGeneratedModel.from_dict
as that would return aGeneratedModel
.Describe the solution you'd like
Update the
from_dict
template inopenapi_python_client/templates/model.pyi
to be a@classmethod
instead of a@staticmethod
and use the passed class object to instantiate the model.i.e. change from
to
Describe alternatives you've considered
Manually creating a
from_dict
method on the extended class.The text was updated successfully, but these errors were encountered: