类型 'List<Serializable>' 不是类型 'List<MyManagedObject>' 的子类型

type 'List<Serializable>' is not a subtype of type 'List<MyManagedObject>'

我正在使用 aqueduct,但收到错误消息

'List<Serializable>' is not a subtype of type 'List<MyManagedObject>' of 'list' #0 _TypeError._throwNew (dart:core/runtime/liberrors_patch.dart:89:51)

但我不知道是什么?我 运行 我的代码没问题,只是我收到了这个我无法解决的错误,我 google 很多,但我找不到解决方案。 这是我的 'entrypoint'

@override
Controller get entryPoint {
  final router = Router();
  router
        .route('${apiBaseUrl}/objects')
        .link(() => ObjectController(context));
}

这是我的post方法:

@Operation.post()
Future<Response> createMyObject(@Bind.body() List<MyManagedObject> list) async {
  ...
  return Response.ok("ok");
}

我认为这可能是 lib 的错误,但我不知道。

Dart 2.1.1 中的重大更改导致绑定列表出现问题。它已在 Aqueduct 3.2(今天 3/7 发布)中修复。