pgjones / quart-schema

Quart-Schema is a Quart extension that provides schema validation and auto-generated API documentation.
MIT License
76 stars 24 forks source link

Support Pydantic V2 #48

Closed justdan6 closed 1 year ago

justdan6 commented 1 year ago

Related to #46

Instructions at https://docs.pydantic.dev/2.0/migration/

skwzrd commented 1 year ago

I just ran into this issue

python3.10 main.py

Traceback (most recent call last):
  File "/media/usb/src/main.py", line 5, in <module>
    from quart_schema import validate_request
  File "/home/user/.local/lib/python3.10/site-packages/quart_schema/__init__.py", line 1, in <module>
    from .documentation import (
  File "/home/user/.local/lib/python3.10/site-packages/quart_schema/documentation.py", line 3, in <module>
    from pydantic.schema import model_schema
ImportError: cannot import name 'model_schema' from 'pydantic.schema' (/home/user/.local/lib/python3.10/site-packages/pydantic/schema.py)

Downgrading to Pydantic version 1.10.12 works for me.

rei-ber commented 1 year ago

Same error here. Downgrading of pydantic fixes it.

pgjones commented 1 year ago

See 50675398e347ee54046c1ce0a5dc2d5579ce63cf