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
94 stars 43 forks source link

Nullable enums in multipart/form-data requests #249

Closed MartynasZabulionis closed 1 month ago

MartynasZabulionis commented 1 month ago

Steps to reproduce

Erroneous code is generated for multipart/form-data API requests which accept optional enum field. There is no check whether the provided enum argument is not null. Also enum itself, not it's String name is added to the fields map.

Expected results

image

Actual results

image

Code sample

No response

Logs

No response

Dart version and used packages versions

Dart 3.4.3

dependencies:
  retrofit: ^4.1.0
  json_annotation: ^4.9.0
  openapi_generator_annotations: ^5.0.2
dev_dependencies:
  swagger_parser: ^1.18.0
  retrofit_generator: ^8.1.2
  json_serializable: ^6.8.0 
  openapi_generator: ^5.0.2
MartynasZabulionis commented 1 month ago

A bug from another package.