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] Duplicated enums/maps and invalid convertResponse #469

Closed
point-source opened this issue Sep 20, 2022 · 3 comments · Fixed by #479
Closed

[BUG] Duplicated enums/maps and invalid convertResponse #469

point-source opened this issue Sep 20, 2022 · 3 comments · Fixed by #479
Assignees
Labels
bug Something isn't working Triage needed

Comments

@point-source
Copy link

point-source commented Sep 20, 2022

Describe the bug
When generating an sdk using this swagger file, some map or enums such as these are duplicated:

  • enum Target
  • const $TargetMap

Screen Shot 2022-09-20 at 10 36 30 AM

Additionally, the generated json converter's convertResponse method is not a valid override if the original.
Screen Shot 2022-09-20 at 10 37 39 AM

To Reproduce
Use this swagger file: https://gist.github.com/point-source/f2b45af0f84a57ee1b39ccc11730ccc7
Use these build.yaml options:

targets:
  $default:
    builders:
      swagger_dart_code_generator:
        options:
          input_folder: "lib/swaggers"
          output_folder: "lib/generated/"
          separate_models: true

Expected behavior
A fully functioning library should be generated without compile errors

Swagger specification link
Link to swagger/OpenApi documentation

Library version used:
Dart: 2.17.6
swagger codegen: 2.8.1

Note, this is the same swagger and setting as issue #458 so I would expect tests to be failing on that ticket too.

@Vovanella95
Copy link
Collaborator

Hi @point-source , will handle it

@Vovanella95
Copy link
Collaborator

Hi @point-source , FutureOr happens because we started to support newest chopper version.

To fix it you can upgrade chopper to 5+ version or fix it by hands.

I will fix duplicated enums asap

@Vovanella95
Copy link
Collaborator

Hi @point-source

I'm on business trip next 2 weeks. Will handle all tickets asap when return home :)

Vovanella95 pushed a commit that referenced this issue Oct 31, 2022
@Vovanella95 Vovanella95 mentioned this issue Oct 31, 2022
Vovanella95 added a commit that referenced this issue Oct 31, 2022
Co-authored-by: Uladzimir Paliukhovich <[email protected]>
Vovanella95 added a commit that referenced this issue Nov 1, 2022
* Fixed #469

* Fixed generation of list of enums instead of enums when needed

Co-authored-by: Uladzimir Paliukhovich <[email protected]>
Vovanella95 added a commit that referenced this issue Nov 3, 2022
* Fixed #469

* Fixed generation of list of enums instead of enums when needed

* Implemented models overrides

* Added models overrides feature

* Commited needed code

* Reimplemented models overrides

* Some fixes

* Added import to separate models

* Updated example according new feature
Updated pubspec and changelog

* Fixed conflicts

* Removed unused import

Co-authored-by: Uladzimir Paliukhovich <[email protected]>
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
Development

Successfully merging a pull request may close this issue.

3 participants