Skip to content

Commit

Permalink
fix python 3.10 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yctomwang committed Jan 8, 2024
1 parent 80db218 commit 37c79eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion flask_pydantic/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@ def wrapper(*args, **kwargs):
body_model = body_in_kwargs or body
if body_model:
body_params = get_body_dict(**(get_json_params or {}))
if "RootModel" in body_model.model_fields or 'root' in body_model.__annotations__:
if "RootModel" in body_model.model_fields or 'root' in body_model.__annotations__ \
or 'root' in body_model.model_fields:
try:
b = body_model(root=body_params).root
except ValidationError as ve:
Expand Down

0 comments on commit 37c79eb

Please sign in to comment.