yanyongyu / githubkit

The modern, all-batteries-included GitHub SDK for Python, including rest api, graphql, webhooks, like octokit!
MIT License
159 stars 21 forks source link

Feature: Support pydantic v2 #45

Closed sudosubin closed 10 months ago

sudosubin commented 10 months ago

Related Issues

Description

yanyongyu commented 10 months ago

I'm not sure that set is a good way to replace the unique list since the set type does not contain order information. But i find an other way to impl this in the pydantic issue https://github.com/pydantic/pydantic-core/pull/820#issuecomment-1670475909. If we don't need to keep the order information, the set type is recommended.

sudosubin commented 10 months ago

Thank you for the feedback. I applied your comment :D

GitHub's OpenAPI does not yet have a schema with uniqueItems=True, but if one exists in the future, it will be safer to keep the order.

yanyongyu commented 10 months ago

Thanks foryour great help with this feature. I still need to investigate how to make it compatible with pydantic v1 and v2 after this pr is merged. The codegen part should be rewrited to support features including compatibility layer, lazy loading logic and api versioning. This may take a long time before release since i do not have too much free time.