It looks like the servers argument to the QuartSchema class causes a serialization error with Pydantic V2. Here is some example code:
from quart import Quart
from quart_schema import QuartSchema, Server
app = Quart(__name__)
QuartSchema(app, servers=[Server(url='http://cool.internet')])
@app.route("/")
async def root() -> str:
"""Root page."""
return "Hello!"
Accessing /openapi.json yields the following error:
TypeError: Object of type 'Url' is not JSON serializable
We've tried all different combinations of Pydantic object magic, but as far as we can tell quart-schemaforces the type to be Server, which can't be serialized with Pydantic V2. Any assistance would be welcome!
For reference, this was with Python 3.10.12, and pip list says:
Hello, thanks for
quart-schema
!It looks like the
servers
argument to theQuartSchema
class causes a serialization error with Pydantic V2. Here is some example code:Accessing
/openapi.json
yields the following error:We've tried all different combinations of Pydantic object magic, but as far as we can tell
quart-schema
forces the type to beServer
, which can't be serialized with Pydantic V2. Any assistance would be welcome!For reference, this was with Python 3.10.12, and
pip list
says: