Skip to content

Commit f5f53c3

Browse files
committed
Fix *root_model_list
1 parent 4e0ff9f commit f5f53c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

flask_openapi3/request.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import json
55
from json import JSONDecodeError
66
from types import UnionType
7-
from typing import Any, Type, Optional, Dict, get_origin, get_args, Union
7+
from typing import Any, Type, Optional, Dict, get_origin, get_args, Union, TypeVar
88

99
from flask import request, current_app, abort
1010
from pydantic import ValidationError, BaseModel, RootModel
@@ -144,7 +144,7 @@ def _validate_body(body: Type[BaseModel], func_kwargs: dict):
144144
if is_application_json(request.mimetype):
145145
if get_origin(body) == UnionType:
146146
root_model_list = [model for model in get_args(body)]
147-
Body = RootModel[Union[*root_model_list]] # type: ignore
147+
Body = RootModel[Union[tuple(root_model_list)]] # type: ignore
148148
else:
149149
Body = body # type: ignore
150150
obj = request.get_json(silent=True)

0 commit comments

Comments
 (0)