Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Generated files fails because of major change in Chopper v8.0.0 #749

Closed
RoarGronmo opened this issue May 10, 2024 · 16 comments
Closed
Assignees
Labels
bug Something isn't working Triage needed

Comments

@RoarGronmo
Copy link

Describe the bug
Generated code is failing on interceptors because of breaking changes in chopper v8.0.0

To Reproduce

  • Upgrade to chopper v8.0.0
  • Try to generate by swagger file (which should produce use of interceptors)

Expected behavior
Flawless code generation

Swagger specification link
Links to breaking change in chopper:
https://pub.dev/packages/chopper/changelog
lejard-h/chopper#547

Library version used:
swagger_dart_code_generator: ^2.15.2

Additional context
Seems still valid if chopper v.7.4.x is used

@RoarGronmo RoarGronmo added bug Something isn't working Triage needed labels May 10, 2024
@diegotori
Copy link
Contributor

@Vovanella95 gentle reminder that this will block folks like us that want to use the latest version of Chopper while using this library. Thanks in advance.

@praneethk666
Copy link

praneethk666 commented May 11, 2024

error: the argument type iterable dynamic' can't be assigned to the parameter type
list interceptor
in swagger_json.swagger.dart.

@RoarGronmo
Copy link
Author

@fryette Can you take a look at this issue ?

@diegotori
Copy link
Contributor

@Vovanella95 looks like you're currently active today according to your Github activity. Just another gentle reminder regarding this issue. Thanks.

@af-chacon
Copy link

af-chacon commented May 15, 2024

The line in question is the following:

Iterable<dynamic>?

Needs to be changed to

List<Interceptor>?

I have a local build with this change that fixes it. lmk if I can provide any more help.

@af-chacon
Copy link

@diegotori you can change your autogenerated code for now to use List<Interceptor>? interceptors instead of Iterable<dynamic>? interceptors at the class defenition that extends ChopperService in you name.swagger.dart file.

That should get you unblocked.

@af-chacon
Copy link

@fryette @Vovanella95 Can either of you take a look at the PR?

af-chacon added a commit to InDive-Media/swagger-dart-code-generator that referenced this issue May 19, 2024
@RoarGronmo
Copy link
Author

Are @fryette and @Vovanella95 still alive ?

@diegotori
Copy link
Contributor

Are @fryette and @Vovanella95 still alive ?

Based on @Vovanella95's activity, looks like he is, since he's been opening PRs in another project.

Perhaps he's getting slammed with other pressing matters.

@Vovanella95 ball is in your court.

@RoarGronmo
Copy link
Author

@af-chacon Do you have a "setup" on how we can use your fork with your fix PR of this repository (I am not to familiar with how .yaml works) in our projects, until @fryette or @Vovanella95 wakes up ?

@RoarGronmo
Copy link
Author

@af-chacon Do you have a "setup" on how we can use your fork with your fix PR of this repository (I am not to familiar with how .yaml works) in our projects, until @fryette or @Vovanella95 wakes up ?

Found a solution for this one:
In pubspec.yaml:

Replace current dependency: swagger_dart_code_generator: ^2.15.2
with:

  swagger_dart_code_generator:
    git:
      url: https://github.com/epam-cross-platform-lab/swagger-dart-code-generator.git
      ref: bacb7781f94e44cb217f163aee8cb681b40d55af
  1. Run flutter pub upgrade --major-versions
  2. Run flutter pub get (just for the case of it)
  3. Run dart run build_runner build --delete-conflicting-outputs
  4. Build your flutter program...

I hope @fryette and @Vovanella95 is still alive, but I fear this dependency to die soon if no one maintains it anymore, it has lowered its score to 120 now... ...I may look for a replacement if we don't hear from them in 2-3 months.

@MartinAKovachev
Copy link

We need a fix asap (update to the latest chopper version). It's a real struggle to update tens of swagger files because this issue.

@RoarGronmo
Copy link
Author

We need a fix asap (update to the latest chopper version). It's a real struggle to update tens of swagger files because this issue.

Have you tried the intermediate solution above, until @Vovanella95 or @fryette responds ?

@juliansteenbakker
Copy link
Contributor

You can use the following until a new version is released.

  swagger_dart_code_generator:
    git:
      url: https://github.com/af-chacon/swagger-dart-code-generator
      ref: user/aedis/fix-chopper-8-iterceptor-generation

@Rodsevich
Copy link
Contributor

Any updates on this, guys? @Vovanella95 @fryette ? Is there a chance you give merge/publish permissions for anyone else?

@Vovanella95
Copy link
Collaborator

Should be fine in next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Triage needed
Projects
None yet
9 participants