-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
[Dart 2] Add support for Dart 2 #754
Conversation
@swipesight thanks for the PR. Is it correct to say that this will break users using Dart 1.x? Shall we add an option e.g. I believe most Dart developers should still be using Dart 1.x as Dart 2.0.0 (stable version) was only released yesterday/today. |
@wing328 How about adding a new generator for Dart2? |
@swipesight that's one way to do it but I would a prefer a single generator for Dart if Dart 1.x and Dart 2.x are not very different. I believe Dart2 can still use Dart 1.x library, right? In other words, we don't need to update the dependency. |
@wing328 I'll see if I can add an option for Dart2. |
@swipesight 👌 let me know if you need any help. Python flask generator has something similar: Search for supportPython2 or SUPPORT_PYAHON2 will reveal how the option is implemented in that file. Hope this helps. |
@wing328 I have added an option for Dart 2. |
@swipesight I tried to add Dart2 petstore samples to the Travis build but it reports the following error:
Would you please take a look when you've time? Basically, the test runs the following in the folder pub get
pub build test |
@wing328 Sure, I'll check out later. |
This PR solves version issues when upgrading to latest flutter version. |
@swipesight I've pushed 7d2edf4 to move the Dart2 petstore test to the end as some records created by the Dart2 petstore tests are invalid (e.g. status not set probably). I'll follow up with you later to fix those test cases. If the CI tests are green, I'll merge this PR into master |
@wing328 I'll fix these tests and then send another PR. |
@swipesight thanks! We'll send out a tweet to promote the awesome Dart2 support you added. Do you have a Twitter account? If yes, we'll tag you in our tweet (https://twitter.com/oas_generator) If you need help fixing the tests, please let me know. |
@wing328 Thanks! Here is my twitter https://twitter.com/swipesight |
Set Dart2 as the default via #949 |
@swipesight thanks again for adding Dart2 support, which is included in the v3.3.0 minor release: https://twitter.com/oas_generator/status/1046941449609068544 |
* Add an option for Dart2 * add dart2 samples, update travis * fix dart installation * Upper constraints on the SDK version * Update dependencies * supportDart2 option can now be passed through --additional-properties * Update petstore tests * Update dart2-petstore.sh * Running tests on Dart VM * Fixed JSON deserialization bugs * Fixed missing initialization of postBody * Run bin/dart2-petstore.sh to regenerate libraries * Update pom.xml * Added SDK version constraints in pubspec.mustache * Run bin/dart2-petstore.sh to regenerate libraries * move dart2 test to the end
PR checklist
./bin/
to update Petstore sample so that CIs can verify the change. (For instance, only need to run./bin/{LANG}-petstore.sh
and./bin/security/{LANG}-petstore.sh
if updating the {LANG} (e.g. php, ruby, python, etc) code generator or {LANG} client's mustache templates). Windows batch files can be found in.\bin\windows\
.master
,4.0.x
. Default:master
.@ircecho
Description of the PR
Added an config option for Dart 2.