-
-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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][dart-dio] Fix collection and date default values not compiling #8306
[dart][dart-dio] Fix collection and date default values not compiling #8306
Conversation
👍 Thanks for opening this issue! The team will review the labels and make any necessary changes. |
I think with this bug would be more sensible to make a major breaking change and untie dart-dio from built_value. It's a 3rd party library and the deeper this goes the more bugs and incompatibilities will cause. |
I disagree, same things are broken/not supported in the normal Dart generator. This has nothing to do with built_value. |
I mean, I am all for adding an option to switch the serialization/generation library if anyone wants to contribute but I don't see it happen anytime soon. |
Build failures unrelated, some Docker pull failure. |
Not specific to this generator, but in general, I think adding dependency on a 3rd party library to handle things as simple as lists and maps shouldn't have place in generated code. The worst thing about whole dart are hard dependencies on analyzer, it's a bad joke when I can't use latest dart-angular with dart.inject because there's a conflict on Approved because you're clearly responsible for this generator and know what's best for it! |
* empty arrays are now correctly generated * default arrays with values are empty * date/dateTime is now always null in order to prevent compile errors
1a0f5ff
to
9ceb3a2
Compare
return "MapBuilder()"; | ||
} | ||
if (ModelUtils.isDateSchema(schema) || ModelUtils.isDateTimeSchema(schema)) { | ||
// this is currently not supported and would create compile errors |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI. I'll add a warning in another PR.
Fixes #8285
PR checklist
./bin/generate-samples.sh
to update all Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master. These must match the expectations made by your contribution. You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example./bin/generate-samples.sh bin/configs/java*
. For Windows users, please run the script in Git BASH.master
,5.1.x
,6.0.x
CC @swipesight (2018/09) @jaumard (2018/09) @josh-burton (2019/12) @amondnet (2019/12) @sbu-WBT (2020/12) @kuhnroyal (2020/12) @agilob (2020/12)