Skip to content

Commit 8f89a94

Browse files
authored
Merge pull request #8 from just495/patch/fix-complex-type-schema
fix complex type list
2 parents 5d5a0c6 + 99e2737 commit 8f89a94

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

fastapi_rest_jsonapi/signature.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99
)
1010
from typing import (
1111
Callable,
12+
Dict,
13+
List,
1214
Optional,
15+
Set,
1316
Type,
1417
OrderedDict as OrderedDictType,
1518
)
@@ -70,11 +73,11 @@ def update_signature(
7073
params: list = list(params_dict.values())
7174
for name, field in (schema and schema.__fields__ or {}).items():
7275
try:
73-
if field.sub_fields:
76+
if issubclass(field.type_, (dict, BaseModel, list, set, List, Set, Dict)):
77+
continue
78+
elif field.sub_fields:
7479
default = Query(None, alias="filter[{alias}]".format(alias=field.alias))
7580
type_field = field.type_
76-
elif issubclass(field.type_, (dict, BaseModel)):
77-
continue
7881
elif issubclass(field.type_, Enum):
7982
default = Query(None, alias="filter[{alias}]".format(alias=field.alias), enum=field.type_.values())
8083
type_field = str

0 commit comments

Comments
 (0)