epam-cross-platform-lab / swagger-dart-code-generator

Swagger/OpenAPI code generator based on Chopper and JsonAnnotation for Flutter
Apache License 2.0
259 stars 119 forks source link

Incorrect generated param name #168

Closed mzdm closed 3 years ago

mzdm commented 3 years ago

Swagger/Json file example: https://cloud.ibm.com/apidocs/visual-recognition/visual-recognition-v3.json

This has parameter AcceptLanguage which has a name with a dash Accept-Language

"components": {
    "parameters": {
      "AcceptLanguage": {
        "name": "Accept-Language",
        "in": "header",

This generates: image

instead of enums.$V3ClassifyPostAcceptLanguageMap[Accept - Language] it should call enums.$V3ClassifyPostAcceptLanguageMap[acceptLanguage]

Thanks for this lib btw. 😍. Saves a lot of time.

deps ``` dependencies: flutter: sdk: flutter chopper: ^4.0.0 dev_dependencies: flutter_test: sdk: flutter build_runner: ^1.12.2 json_annotation: 4.0.1 json_serializable: 4.1.2 swagger_dart_code_generator: ^2.0.0-nullsafety.7+2 chopper_generator: ^4.0.0-nullsafety.1 ```
Vovanella95 commented 3 years ago

Hi @mzdm ! Looks like it's easy fix. We will fix it ASAP. (possible today)

Vovanella95 commented 3 years ago

Please check 2.0.0-nullsafety.8

Vovanella95 commented 3 years ago

@mzdm Also thanks for examples of swagger files. It's really helpful.

mzdm commented 3 years ago

Please check 2.0.0-nullsafety.8

Thanks for the fast fix! 💙 I'll try later tomorrow.

mzdm commented 3 years ago

Can confirm it was fixed with 2.0.0-nullsafety.8, thanks!