Dart 类型';列表<;可序列化>';不是类型为';列表<;MyManagedObject>';

Dart 类型';列表<;可序列化>';不是类型为';列表<;MyManagedObject>';,dart,aqueduct,Dart,Aqueduct,我正在使用导水管,我收到了错误 'List<Serializable>' is not a subtype of type 'List<MyManagedObject>' of 'list' #0 _TypeError._throwNew (dart:core/runtime/liberrors_patch.dart:89:51) 这是我的发帖方法: @Operation.post() Future<Response> createMyObject(@Bin

我正在使用
导水管
,我收到了错误

'List<Serializable>' is not a subtype of type 'List<MyManagedObject>' of 'list' #0 _TypeError._throwNew (dart:core/runtime/liberrors_patch.dart:89:51)
这是我的发帖方法:

@Operation.post()
Future<Response> createMyObject(@Bind.body() List<MyManagedObject> list) async {
  ...
  return Response.ok("ok");
}
@Operation.post()
未来的CreateMObject(@Bind.body()列表)异步{
...
返回响应。ok(“ok”);
}

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

Dart 2.1.1中有一个突破性的更改,导致绑定列表出现问题。它已在Aqueduct 3.2(今天3/7发布)中修复。

您是否阅读了序列化文档?他们可能不支持
列表
,但我不确定。。。无论如何,看起来您的列表采用了
MyObject
,错误显示为
MyManagedObject
?感谢Renato,为了更好的抽象,我更改了“MyObject”的实际类。我正在阅读你的链接,但升级后我使用了“列表”,然后就坏了。
@Operation.post()
Future<Response> createMyObject(@Bind.body() List<MyManagedObject> list) async {
  ...
  return Response.ok("ok");
}