diff --git a/README.md b/README.md index f66bdc89..0f15fe79 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ In general case for each .swagger file three outputs will be created.
The generated code uses the following packages in run-time: ```yaml dependencies: - chopper: ^6.1.1 + chopper: ^8.0.0 json_annotation: ^4.8.0 ``` @@ -36,7 +36,7 @@ Add the following to your `pubspec.yaml` file to be able to do code generation: ```yaml dev_dependencies: build_runner: ^2.3.3 - chopper_generator: ^6.0.0 + chopper_generator: ^8.0.0 json_serializable: ^6.6.1 swagger_dart_code_generator: ^2.10.4 ``` diff --git a/example/input_folder/some_file_name.json b/example/input_folder/some_file_name.json index e9a3b569..1c5db9ab 100644 --- a/example/input_folder/some_file_name.json +++ b/example/input_folder/some_file_name.json @@ -1033,4 +1033,4 @@ "description": "Find out more about Swagger", "url": "http://swagger.io" } -} +} \ No newline at end of file diff --git a/example/lib/swagger_generated_code/pet_service_json.swagger.dart b/example/lib/swagger_generated_code/pet_service_json.swagger.dart index da4499fc..1366b1db 100644 --- a/example/lib/swagger_generated_code/pet_service_json.swagger.dart +++ b/example/lib/swagger_generated_code/pet_service_json.swagger.dart @@ -31,7 +31,7 @@ abstract class PetServiceJson extends ChopperService { ErrorConverter? errorConverter, Converter? converter, Uri? baseUrl, - Iterable? interceptors, + List? interceptors, }) { if (client != null) { return _$PetServiceJson(client); @@ -489,7 +489,7 @@ class Category { static const fromJsonFactory = _$CategoryFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Category && (identical(other.id, id) || @@ -557,7 +557,7 @@ class User { static const fromJsonFactory = _$UserFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is User && (identical(other.id, id) || @@ -660,7 +660,7 @@ class Tag { static const fromJsonFactory = _$TagFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Tag && (identical(other.id, id) || @@ -714,7 +714,7 @@ class ApiResponse { static const fromJsonFactory = _$ApiResponseFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is ApiResponse && (identical(other.code, code) || diff --git a/example/lib/swagger_generated_code/pet_service_json.swagger.g.dart b/example/lib/swagger_generated_code/pet_service_json.swagger.g.dart index f1bb7df4..c67841f7 100644 --- a/example/lib/swagger_generated_code/pet_service_json.swagger.g.dart +++ b/example/lib/swagger_generated_code/pet_service_json.swagger.g.dart @@ -7,7 +7,7 @@ part of 'pet_service_json.swagger.dart'; // ************************************************************************** Category _$CategoryFromJson(Map json) => Category( - id: json['id'] as int?, + id: (json['id'] as num?)?.toInt(), name: json['name'] as String? ?? '', ); @@ -26,14 +26,14 @@ Map _$CategoryToJson(Category instance) { } User _$UserFromJson(Map json) => User( - id: json['id'] as int?, + id: (json['id'] as num?)?.toInt(), username: json['username'] as String? ?? '', firstName: json['firstName'] as String? ?? '', lastName: json['lastName'] as String? ?? '', email: json['email'] as String? ?? '', password: json['password'] as String? ?? '', phone: json['phone'] as String? ?? '', - userStatus: json['userStatus'] as int?, + userStatus: (json['userStatus'] as num?)?.toInt(), ); Map _$UserToJson(User instance) { @@ -57,7 +57,7 @@ Map _$UserToJson(User instance) { } Tag _$TagFromJson(Map json) => Tag( - id: json['id'] as int?, + id: (json['id'] as num?)?.toInt(), name: json['name'] as String? ?? '', ); @@ -76,7 +76,7 @@ Map _$TagToJson(Tag instance) { } ApiResponse _$ApiResponseFromJson(Map json) => ApiResponse( - code: json['code'] as int?, + code: (json['code'] as num?)?.toInt(), type: json['type'] as String? ?? '', message: json['message'] as String? ?? '', ); diff --git a/example/lib/swagger_generated_code/pet_service_swagger.swagger.dart b/example/lib/swagger_generated_code/pet_service_swagger.swagger.dart index ff590f3f..143b2938 100644 --- a/example/lib/swagger_generated_code/pet_service_swagger.swagger.dart +++ b/example/lib/swagger_generated_code/pet_service_swagger.swagger.dart @@ -30,7 +30,7 @@ abstract class PetServiceSwagger extends ChopperService { ErrorConverter? errorConverter, Converter? converter, Uri? baseUrl, - Iterable? interceptors, + List? interceptors, }) { if (client != null) { return _$PetServiceSwagger(client); @@ -504,7 +504,7 @@ class Order { static const fromJsonFactory = _$OrderFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Order && (identical(other.id, id) || @@ -592,7 +592,7 @@ class Category { static const fromJsonFactory = _$CategoryFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Category && (identical(other.id, id) || @@ -660,7 +660,7 @@ class User { static const fromJsonFactory = _$UserFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is User && (identical(other.id, id) || @@ -763,7 +763,7 @@ class Tag { static const fromJsonFactory = _$TagFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Tag && (identical(other.id, id) || @@ -830,7 +830,7 @@ class Pet { static const fromJsonFactory = _$PetFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Pet && (identical(other.id, id) || @@ -920,7 +920,7 @@ class ApiResponse { static const fromJsonFactory = _$ApiResponseFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is ApiResponse && (identical(other.code, code) || diff --git a/example/lib/swagger_generated_code/pet_service_swagger.swagger.g.dart b/example/lib/swagger_generated_code/pet_service_swagger.swagger.g.dart new file mode 100644 index 00000000..6a6db050 --- /dev/null +++ b/example/lib/swagger_generated_code/pet_service_swagger.swagger.g.dart @@ -0,0 +1,159 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pet_service_swagger.swagger.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Order _$OrderFromJson(Map json) => Order( + id: (json['id'] as num?)?.toInt(), + petId: (json['petId'] as num?)?.toInt(), + quantity: (json['quantity'] as num?)?.toInt(), + shipDate: json['shipDate'] == null + ? null + : DateTime.parse(json['shipDate'] as String), + status: orderStatusNullableFromJson(json['status']), + complete: json['complete'] as bool? ?? false, + ); + +Map _$OrderToJson(Order instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('petId', instance.petId); + writeNotNull('quantity', instance.quantity); + writeNotNull('shipDate', instance.shipDate?.toIso8601String()); + writeNotNull('status', orderStatusNullableToJson(instance.status)); + writeNotNull('complete', instance.complete); + return val; +} + +Category _$CategoryFromJson(Map json) => Category( + id: (json['id'] as num?)?.toInt(), + name: json['name'] as String? ?? '', + ); + +Map _$CategoryToJson(Category instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('name', instance.name); + return val; +} + +User _$UserFromJson(Map json) => User( + id: (json['id'] as num?)?.toInt(), + username: json['username'] as String? ?? '', + firstName: json['firstName'] as String? ?? '', + lastName: json['lastName'] as String? ?? '', + email: json['email'] as String? ?? '', + password: json['password'] as String? ?? '', + phone: json['phone'] as String? ?? '', + userStatus: (json['userStatus'] as num?)?.toInt(), + ); + +Map _$UserToJson(User instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('username', instance.username); + writeNotNull('firstName', instance.firstName); + writeNotNull('lastName', instance.lastName); + writeNotNull('email', instance.email); + writeNotNull('password', instance.password); + writeNotNull('phone', instance.phone); + writeNotNull('userStatus', instance.userStatus); + return val; +} + +Tag _$TagFromJson(Map json) => Tag( + id: (json['id'] as num?)?.toInt(), + name: json['name'] as String? ?? '', + ); + +Map _$TagToJson(Tag instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('name', instance.name); + return val; +} + +Pet _$PetFromJson(Map json) => Pet( + id: (json['id'] as num?)?.toInt(), + category: json['category'] == null + ? null + : Category.fromJson(json['category'] as Map), + name: json['name'] as String? ?? '', + photoUrls: (json['photoUrls'] as List?) + ?.map((e) => e as String) + .toList(), + tags: (json['tags'] as List?) + ?.map((e) => Tag.fromJson(e as Map)) + .toList(), + status: petStatusNullableFromJson(json['status']), + ); + +Map _$PetToJson(Pet instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('category', instance.category?.toJson()); + writeNotNull('name', instance.name); + writeNotNull('photoUrls', instance.photoUrls); + writeNotNull('tags', instance.tags?.map((e) => e.toJson()).toList()); + writeNotNull('status', petStatusNullableToJson(instance.status)); + return val; +} + +ApiResponse _$ApiResponseFromJson(Map json) => ApiResponse( + code: (json['code'] as num?)?.toInt(), + type: json['type'] as String? ?? '', + message: json['message'] as String? ?? '', + ); + +Map _$ApiResponseToJson(ApiResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('code', instance.code); + writeNotNull('type', instance.type); + writeNotNull('message', instance.message); + return val; +} diff --git a/example/lib/swagger_generated_code/pet_service_yaml.swagger.dart b/example/lib/swagger_generated_code/pet_service_yaml.swagger.dart index 504b04ed..9c399fcc 100644 --- a/example/lib/swagger_generated_code/pet_service_yaml.swagger.dart +++ b/example/lib/swagger_generated_code/pet_service_yaml.swagger.dart @@ -30,7 +30,7 @@ abstract class PetServiceYaml extends ChopperService { ErrorConverter? errorConverter, Converter? converter, Uri? baseUrl, - Iterable? interceptors, + List? interceptors, }) { if (client != null) { return _$PetServiceYaml(client); @@ -504,7 +504,7 @@ class Order { static const fromJsonFactory = _$OrderFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Order && (identical(other.id, id) || @@ -592,7 +592,7 @@ class Category { static const fromJsonFactory = _$CategoryFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Category && (identical(other.id, id) || @@ -660,7 +660,7 @@ class User { static const fromJsonFactory = _$UserFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is User && (identical(other.id, id) || @@ -763,7 +763,7 @@ class Tag { static const fromJsonFactory = _$TagFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Tag && (identical(other.id, id) || @@ -830,7 +830,7 @@ class Pet { static const fromJsonFactory = _$PetFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Pet && (identical(other.id, id) || @@ -920,7 +920,7 @@ class ApiResponse { static const fromJsonFactory = _$ApiResponseFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is ApiResponse && (identical(other.code, code) || diff --git a/example/lib/swagger_generated_code/pet_service_yaml.swagger.g.dart b/example/lib/swagger_generated_code/pet_service_yaml.swagger.g.dart new file mode 100644 index 00000000..58d2fce6 --- /dev/null +++ b/example/lib/swagger_generated_code/pet_service_yaml.swagger.g.dart @@ -0,0 +1,159 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'pet_service_yaml.swagger.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Order _$OrderFromJson(Map json) => Order( + id: (json['id'] as num?)?.toInt(), + petId: (json['petId'] as num?)?.toInt(), + quantity: (json['quantity'] as num?)?.toInt(), + shipDate: json['shipDate'] == null + ? null + : DateTime.parse(json['shipDate'] as String), + status: orderStatusNullableFromJson(json['status']), + complete: json['complete'] as bool? ?? false, + ); + +Map _$OrderToJson(Order instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('petId', instance.petId); + writeNotNull('quantity', instance.quantity); + writeNotNull('shipDate', instance.shipDate?.toIso8601String()); + writeNotNull('status', orderStatusNullableToJson(instance.status)); + writeNotNull('complete', instance.complete); + return val; +} + +Category _$CategoryFromJson(Map json) => Category( + id: (json['id'] as num?)?.toInt(), + name: json['name'] as String? ?? '', + ); + +Map _$CategoryToJson(Category instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('name', instance.name); + return val; +} + +User _$UserFromJson(Map json) => User( + id: (json['id'] as num?)?.toInt(), + username: json['username'] as String? ?? '', + firstName: json['firstName'] as String? ?? '', + lastName: json['lastName'] as String? ?? '', + email: json['email'] as String? ?? '', + password: json['password'] as String? ?? '', + phone: json['phone'] as String? ?? '', + userStatus: (json['userStatus'] as num?)?.toInt(), + ); + +Map _$UserToJson(User instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('username', instance.username); + writeNotNull('firstName', instance.firstName); + writeNotNull('lastName', instance.lastName); + writeNotNull('email', instance.email); + writeNotNull('password', instance.password); + writeNotNull('phone', instance.phone); + writeNotNull('userStatus', instance.userStatus); + return val; +} + +Tag _$TagFromJson(Map json) => Tag( + id: (json['id'] as num?)?.toInt(), + name: json['name'] as String? ?? '', + ); + +Map _$TagToJson(Tag instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('name', instance.name); + return val; +} + +Pet _$PetFromJson(Map json) => Pet( + id: (json['id'] as num?)?.toInt(), + category: json['category'] == null + ? null + : Category.fromJson(json['category'] as Map), + name: json['name'] as String? ?? '', + photoUrls: (json['photoUrls'] as List?) + ?.map((e) => e as String) + .toList(), + tags: (json['tags'] as List?) + ?.map((e) => Tag.fromJson(e as Map)) + .toList(), + status: petStatusNullableFromJson(json['status']), + ); + +Map _$PetToJson(Pet instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('category', instance.category?.toJson()); + writeNotNull('name', instance.name); + writeNotNull('photoUrls', instance.photoUrls); + writeNotNull('tags', instance.tags?.map((e) => e.toJson()).toList()); + writeNotNull('status', petStatusNullableToJson(instance.status)); + return val; +} + +ApiResponse _$ApiResponseFromJson(Map json) => ApiResponse( + code: (json['code'] as num?)?.toInt(), + type: json['type'] as String? ?? '', + message: json['message'] as String? ?? '', + ); + +Map _$ApiResponseToJson(ApiResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('code', instance.code); + writeNotNull('type', instance.type); + writeNotNull('message', instance.message); + return val; +} diff --git a/example/lib/swagger_generated_code/some_file_name.swagger.dart b/example/lib/swagger_generated_code/some_file_name.swagger.dart index dacfaaf5..fa0cf1f5 100644 --- a/example/lib/swagger_generated_code/some_file_name.swagger.dart +++ b/example/lib/swagger_generated_code/some_file_name.swagger.dart @@ -30,7 +30,7 @@ abstract class SomeFileName extends ChopperService { ErrorConverter? errorConverter, Converter? converter, Uri? baseUrl, - Iterable? interceptors, + List? interceptors, }) { if (client != null) { return _$SomeFileName(client); @@ -504,7 +504,7 @@ class Order { static const fromJsonFactory = _$OrderFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Order && (identical(other.id, id) || @@ -592,7 +592,7 @@ class Category { static const fromJsonFactory = _$CategoryFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Category && (identical(other.id, id) || @@ -660,7 +660,7 @@ class User { static const fromJsonFactory = _$UserFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is User && (identical(other.id, id) || @@ -763,7 +763,7 @@ class Tag { static const fromJsonFactory = _$TagFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Tag && (identical(other.id, id) || @@ -830,7 +830,7 @@ class Pet { static const fromJsonFactory = _$PetFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is Pet && (identical(other.id, id) || @@ -920,7 +920,7 @@ class ApiResponse { static const fromJsonFactory = _$ApiResponseFromJson; @override - bool operator ==(dynamic other) { + bool operator ==(Object other) { return identical(this, other) || (other is ApiResponse && (identical(other.code, code) || diff --git a/example/lib/swagger_generated_code/some_file_name.swagger.g.dart b/example/lib/swagger_generated_code/some_file_name.swagger.g.dart new file mode 100644 index 00000000..a709452f --- /dev/null +++ b/example/lib/swagger_generated_code/some_file_name.swagger.g.dart @@ -0,0 +1,159 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'some_file_name.swagger.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +Order _$OrderFromJson(Map json) => Order( + id: (json['id'] as num?)?.toInt(), + petId: (json['petId'] as num?)?.toInt(), + quantity: (json['quantity'] as num?)?.toInt(), + shipDate: json['shipDate'] == null + ? null + : DateTime.parse(json['shipDate'] as String), + status: orderStatusNullableFromJson(json['status']), + complete: json['complete'] as bool? ?? false, + ); + +Map _$OrderToJson(Order instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('petId', instance.petId); + writeNotNull('quantity', instance.quantity); + writeNotNull('shipDate', instance.shipDate?.toIso8601String()); + writeNotNull('status', orderStatusNullableToJson(instance.status)); + writeNotNull('complete', instance.complete); + return val; +} + +Category _$CategoryFromJson(Map json) => Category( + id: (json['id'] as num?)?.toInt(), + name: json['name'] as String? ?? '', + ); + +Map _$CategoryToJson(Category instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('name', instance.name); + return val; +} + +User _$UserFromJson(Map json) => User( + id: (json['id'] as num?)?.toInt(), + username: json['username'] as String? ?? '', + firstName: json['firstName'] as String? ?? '', + lastName: json['lastName'] as String? ?? '', + email: json['email'] as String? ?? '', + password: json['password'] as String? ?? '', + phone: json['phone'] as String? ?? '', + userStatus: (json['userStatus'] as num?)?.toInt(), + ); + +Map _$UserToJson(User instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('username', instance.username); + writeNotNull('firstName', instance.firstName); + writeNotNull('lastName', instance.lastName); + writeNotNull('email', instance.email); + writeNotNull('password', instance.password); + writeNotNull('phone', instance.phone); + writeNotNull('userStatus', instance.userStatus); + return val; +} + +Tag _$TagFromJson(Map json) => Tag( + id: (json['id'] as num?)?.toInt(), + name: json['name'] as String? ?? '', + ); + +Map _$TagToJson(Tag instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('name', instance.name); + return val; +} + +Pet _$PetFromJson(Map json) => Pet( + id: (json['id'] as num?)?.toInt(), + category: json['category'] == null + ? null + : Category.fromJson(json['category'] as Map), + name: json['name'] as String? ?? '', + photoUrls: (json['photoUrls'] as List?) + ?.map((e) => e as String) + .toList(), + tags: (json['tags'] as List?) + ?.map((e) => Tag.fromJson(e as Map)) + .toList(), + status: petStatusNullableFromJson(json['status']), + ); + +Map _$PetToJson(Pet instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('id', instance.id); + writeNotNull('category', instance.category?.toJson()); + writeNotNull('name', instance.name); + writeNotNull('photoUrls', instance.photoUrls); + writeNotNull('tags', instance.tags?.map((e) => e.toJson()).toList()); + writeNotNull('status', petStatusNullableToJson(instance.status)); + return val; +} + +ApiResponse _$ApiResponseFromJson(Map json) => ApiResponse( + code: (json['code'] as num?)?.toInt(), + type: json['type'] as String? ?? '', + message: json['message'] as String? ?? '', + ); + +Map _$ApiResponseToJson(ApiResponse instance) { + final val = {}; + + void writeNotNull(String key, dynamic value) { + if (value != null) { + val[key] = value; + } + } + + writeNotNull('code', instance.code); + writeNotNull('type', instance.type); + writeNotNull('message', instance.message); + return val; +} diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 30005b73..0676c35a 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -6,7 +6,7 @@ environment: sdk: ^3.2.3 dependencies: - chopper: ^7.1.0+1 + chopper: ^8.0.0 collection: ^1.18.0 http: ^1.2.0 json_annotation: ^4.8.0 @@ -14,7 +14,7 @@ dependencies: dev_dependencies: swagger_dart_code_generator: path: ../ - chopper_generator: ^7.1.1 + chopper_generator: ^8.0.0 build_runner: ^2.3.3 json_serializable: ^6.6.1 lints: ^3.0.0 diff --git a/lib/src/code_generators/swagger_requests_generator.dart b/lib/src/code_generators/swagger_requests_generator.dart index ef5eeb79..798650b3 100644 --- a/lib/src/code_generators/swagger_requests_generator.dart +++ b/lib/src/code_generators/swagger_requests_generator.dart @@ -118,7 +118,7 @@ class SwaggerRequestsGenerator extends SwaggerGeneratorBase { ..optionalParameters.add(Parameter( (p) => p ..named = true - ..type = Reference('Iterable?') + ..type = Reference('List?') ..name = 'interceptors', )) ..body = Code(body),