from apiflask import Schema
from apiflask.fields import List,Nested
class IDReq(Schema):
user_id = List(required=True,description="ID",cls_or_instance=int)
报错信息如下:
File "E:\Env\TestFlask\lib\site-packages\marshmallow\utils.py", line 320, in resolve_field_instance
raise FieldInstanceResolutionError
marshmallow.exceptions.FieldInstanceResolutionError
......
File "E:\Env\TestFlask\lib\site-packages\marshmallow\fields.py", line 736, in __init__
raise ValueError(
ValueError: The list elements must be a subclass or instance of marshmallow.base.FieldABC.
from apiflask import Schema
from apiflask.fields import List, Integer
class IDReq(Schema):
user_id = List(required=True,description="ID",cls_or_instance=Integer)