Carapacik / swagger_parser

Dart package that takes an OpenApi definition file and generates REST clients based on retrofit and data classes for your project.
https://pub.dev/packages/swagger_parser
MIT License
90 stars 38 forks source link

[WIP] Add functionality to evade conflicts and generate valid code #105

Closed Frumscepend closed 6 months ago

Frumscepend commented 10 months ago

The problems:

  1. Some typedef generating recurrent dependency if they not defined as model
  2. If path and query parameters has the same name then generation makes variables of the same name. That is not an expected output.
  3. Retrofit generating toJson for Date and Object types.

The solutions:

  1. If typedef generation then replace possible this and Object to String
  2. Added prefixes to client parameters equal to annotation name.
  3. Added generation of extension for Date class and imported it in every client

TODO: 1.1. Research if it breaks anything 1.2. Make it for Kotlin generation if needed

2.1. Make it optional with control via hyperparameters 2.2. Handle situation when there are multiple parameters with same name. rfc3986 not denying this.

3.1. Import extension only in classes that requiring it.

  1. Fix tests
StarProxima commented 6 months ago

@Frumscepend I will mark this pr as closed as there have been no updates for a long time. If you want to make another one, feel free to do so.