Skip to content

Commit

Permalink
BREAKING: Add Chopper 8 support (#755)
Browse files Browse the repository at this point in the history
Use `List<Interceptor>` for interceptors to support Chopper 8.

Closes #754
  • Loading branch information
zbarbuto authored Jul 24, 2024
1 parent 9533c64 commit 74d4b8a
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 64 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ In general case for each .swagger file three outputs will be created. </br>
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
```
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
```
Expand Down
2 changes: 1 addition & 1 deletion example/input_folder/some_file_name.json
Original file line number Diff line number Diff line change
Expand Up @@ -1033,4 +1033,4 @@
"description": "Find out more about Swagger",
"url": "http://swagger.io"
}
}
}
10 changes: 5 additions & 5 deletions example/lib/swagger_generated_code/pet_service_json.swagger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ abstract class PetServiceJson extends ChopperService {
ErrorConverter? errorConverter,
Converter? converter,
Uri? baseUrl,
Iterable<dynamic>? interceptors,
List<Interceptor>? interceptors,
}) {
if (client != null) {
return _$PetServiceJson(client);
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract class PetServiceSwagger extends ChopperService {
ErrorConverter? errorConverter,
Converter? converter,
Uri? baseUrl,
Iterable<dynamic>? interceptors,
List<Interceptor>? interceptors,
}) {
if (client != null) {
return _$PetServiceSwagger(client);
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions example/lib/swagger_generated_code/pet_service_yaml.swagger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ abstract class PetServiceYaml extends ChopperService {
ErrorConverter? errorConverter,
Converter? converter,
Uri? baseUrl,
Iterable<dynamic>? interceptors,
List<Interceptor>? interceptors,
}) {
if (client != null) {
return _$PetServiceYaml(client);
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down Expand Up @@ -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) ||
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 74d4b8a

Please sign in to comment.