mike-oakley / openapi-pydantic

Pydantic OpenAPI schema implementation
Other
66 stars 10 forks source link

Compatibility with both Pydantic 1 and 2 #17

Closed hathawsh closed 1 year ago

hathawsh commented 1 year ago

This PR makes the project compatible with both Pydantic 1 and 2. All Tox tests pass. Solved primarily by adding a compat.py shim that implements the changed symbols in 3 ways: Pydantic 1, and Pydantic 2, and type checking.

mike-oakley commented 1 year ago

Closes #16

hathawsh commented 1 year ago

I added version compatibility notes to the README. Let me know if you spot anything else to improve this PR.

mike-oakley commented 1 year ago

Thanks @hathawsh - just tagged 0.3.0 which should be on PyPI imminently 👍🏼