swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
The generated dart code contains deprecations in dart 2. It should be possible to generate code without deprecation warnings. Generating valid dart 1 code should be possible as well.
info • The name of the analysis options file .analysis_options is deprecated; consider renaming it to
analysis_options.yaml • swagger/.analysis_options:1:1
info • 'JSON' is deprecated and shouldn't be used • swagger/lib/api_client.dart:85:23
info • 'JSON' is deprecated and shouldn't be used • swagger/lib/api_client.dart:94:20
info • 'BASE64' is deprecated and shouldn't be used • swagger/lib/auth/http_basic_auth.dart:11:48
info • 'UTF8' is deprecated and shouldn't be used • swagger/lib/auth/http_basic_auth.dart:11:62
Description
The generated dart code contains deprecations in dart 2. It should be possible to generate code without deprecation warnings. Generating valid dart 1 code should be possible as well.
Swagger-codegen version
2.4.0
Swagger declaration file content or url
http://petstore.swagger.io/v2/swagger.json
Command line used for generation
./bin/dart-petstore.sh
Steps to reproduce
flutter analyze
info • The name of the analysis options file .analysis_options is deprecated; consider renaming it to analysis_options.yaml • swagger/.analysis_options:1:1 info • 'JSON' is deprecated and shouldn't be used • swagger/lib/api_client.dart:85:23 info • 'JSON' is deprecated and shouldn't be used • swagger/lib/api_client.dart:94:20 info • 'BASE64' is deprecated and shouldn't be used • swagger/lib/auth/http_basic_auth.dart:11:48 info • 'UTF8' is deprecated and shouldn't be used • swagger/lib/auth/http_basic_auth.dart:11:62
Flutter Version
Flutter 0.5.1 • channel beta • https://github.com/flutter/flutter.git Framework • revision c7ea3ca377 (4 weeks ago) • 2018-05-29 21:07:33 +0200 Engine • revision 1ed25ca7b7 Tools • Dart 2.0.0-dev.58.0.flutter-f981f09760
Suggest a fix/enhancement
I suggest to add a new option for the dart version and generate code accordingly.