Skip to content

Commit

Permalink
Replace pydantic_encoder with to_jsonable_python
Browse files Browse the repository at this point in the history
pydantic_encoder is deprecated in Pydantic v2.
  • Loading branch information
rco-ableton authored and pgjones committed Nov 12, 2023
1 parent bbf561d commit c17bfbf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/quart_schema/extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import click
from humps import camelize
from pydantic import BaseModel
from pydantic.json import pydantic_encoder
from pydantic.json_schema import GenerateJsonSchema
from pydantic_core import to_jsonable_python
from quart import current_app, Quart, render_template_string, Response, ResponseReturnValue
from quart.cli import pass_script_info, ScriptInfo
from quart.json.provider import DefaultJSONProvider
Expand Down Expand Up @@ -114,7 +114,7 @@ def default(object_: Any) -> Any:
try:
return super().default(object_)
except TypeError:
return pydantic_encoder(object_)
return to_jsonable_python(object_)


def hide(func: Callable) -> Callable:
Expand Down

0 comments on commit c17bfbf

Please sign in to comment.