appwrite/sdk-for-python

๐Ÿš€ Feature: generate dataclasses from schemas

iron3oxide opened this issue ยท 1 comments

๐Ÿ”– Feature description

As a developer, I want to know what exactly an SDK method, for example Accounts.get(), will return. It would be way more useful for this method to return an Account object with all the fields correctly typed than to receive json as I do at the moment; which leads to me having to write my own models and parsing the json into those (+ error handling ofc).

๐ŸŽค Pitch

Since the schema for e.g. Account is available in the OpenAPI spec, it should be possible to translate it into some form of dataclass. This could be the included dataclasses.dataclass or a pydantic.BaseModel, depending on your preferences regarding extra dependencies.

๐Ÿ‘€ Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

can i handle it , we can use pydantic basemodels due to their large community support and robust docs