Uh oh!
There was an error while loading. Please reload this page.
Dart - update generator to support null safety - #10637
Conversation
agilob
commented
Dec 21, 2021
@jaumard@josh-burton@amondnet@sbu-WBT@kuhnroyal@agilob@ahmednfwela@noordawod any last reviews? can I get green ticks on this PR please? |
ahmednfwela
commented
Dec 21, 2021
note: the java changes also affect other generators |
kuhnroyal
left a comment
There was a problem hiding this comment.
Not looking at all the Dart changes, its just too much.
Uh oh!
There was an error while loading. Please reload this page.
noordawod
commented
Dec 21, 2021
Yeah, it took almost a day's work to painstakinly test, retest and reshape the changes, hopefully with amicable results for the public. But for me it still works in real-life apps and now it's null safe. |
@wing328 can we have this merged to 6.x please! 🎉 |
agilob
commented
Jan 2, 2022
@wing328 pls 👀 |
wing328
commented
Jan 2, 2022
Just merged. Sorry for the delay. |
agilob
commented
Jan 3, 2022
well done everyone :) |
noordawod
commented
Jan 3, 2022
Is there an estimate when v6 will be merged to |
agilob
commented
Jan 3, 2022
This month most likely, with 6.0 release |
fatihozdil
commented
May 17, 2022
| {{{name}}}: json[r'{{{baseName}}}'] == null | ||
| ? null | ||
| : {{{datatypeWithEnum}}}.parse(json[r'{{{baseName}}}'].toString()), | ||
| ? {{#defaultValue}}{{{.}}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} |
There was a problem hiding this comment.
As far as I can tell, this line isn't quite right. It doesn't handle required num types, which will be (correctly) generated as non-nullable, but then this line tries to set them to null when they don't have a default value which won't compile.
is an example of a spec which exhibits this, specifically:
https://raw.githubusercontent.com/SpaceTradersAPI/api-docs/b52734a2cdb63e796174310ebac89f5009df3b9f/models/JumpGate.json


Targeting 6.x as there's plenty of breaking changes here
PR checklist
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.3.0),6.0.x@jaumard@josh-burton@amondnet@sbu-WBT@kuhnroyal@agilob@ahmednfwela