You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@GenApiClient()
class MyFleetApi extends ApiClient with _$MyFleetApiClient {
final Route base;
final Map<String, CodecRepo> converters;
final Duration timeout;
MyFleetApi({this.base, this.converters, this.timeout = const Duration(minutes: 2)});
///
///
///
@GetReq(path: "/cc-myfleet/depots")
Future<List<Depot>> getDepots(
) {
return super.getDepots(
).timeout(timeout);
}
And the corresponding .jretro file:
abstract class _$MyFleetApiClient implements ApiClient {
final String basePath = "";
dynamic getDepots() async {
var req = base.get.path(basePath).path("/cc-myfleet/depots");
return await req.go(throwOnErr: true);
}
The jretro file is returning dynamic now and when running the code the following exception is produced: error: type 'Future<dynamic>' is not a subtype of type 'Future<List<Depot>>'
Previous version for Generator (1.1.4)
The old generator (using flutter 1.x) produced a different output for the .jretro file:
abstract class _$MyFleetApiClient implements ApiClient {
final String basePath = "";
Future<List<Depot>> getDepots() async {
var req = base.get.path(basePath).path("/cc-myfleet/depots");
return req.go(throwOnErr: true).map(decodeList);
}
We switched to flutter 2.0.1 recently and had to rerun our code generation.
We have setup the openapi generator with following data:
pubspec.yaml:
Configuration:
Produced Output with new API
The produced output in the
api
package is now:And the corresponding
.jretro
file:The jretro file is returning
dynamic
now and when running the code the following exception is produced:error: type 'Future<dynamic>' is not a subtype of type 'Future<List<Depot>>'
Previous version for Generator (1.1.4)
The old generator (using flutter 1.x) produced a different output for the
.jretro
file:Basically it added a
.map
call at the end.Was there a change in the generation for Jaguar?
To link: I found the same issue in a different project: Jaguar-dart/client#68
The text was updated successfully, but these errors were encountered: