[dart] fix toJson does not handle complex type#6730
[dart] fix toJson does not handle complex type#6730wing328 merged 2 commits intoOpenAPITools:masterfrom
Conversation
|
Hi, I tested this PR with this https://github.com/geoDavey/osrm-openapi/blob/master/osrm-openapi.yaml OpenAPI specification. For Example: But in the if (destinations != null)
json['destinations'] = destinations;The same problem exists also with objects without lists, if you look inside the annotation.dart. It would be very nice if this could get fixed, because this is a very big problem for serialization. Thank you |
| {{/complexType}} | ||
| {{^complexType}} | ||
| '{{baseName}}': {{name}}{{^-last}},{{/-last}} | ||
| {{/complexType}} |
There was a problem hiding this comment.
@agilob Can we keep the indentation as 2-space? It would make the code review a lot easier.
There was a problem hiding this comment.
This MR will cause a bunch of conflicts with 2 other MR I have in progress and it's not my changes, I resurrected commit from
@arndt-s. I will take care of it as the last thing if you dont mind?
There was a problem hiding this comment.
Agreed with taking care of the code indentation in another PR.
Totally agree, but as per comment above, I think this should be solved after more fundamental problems are solved in dart generation, like basic enums, non-nullable fields. Please also note these aren't my changes. I picked old MR, fixed git conflict and reopened it. |
Rebase of #5189 that fixes #4562
PR checklist
./bin/generate-samples.shto 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/config/java*. For Windows users, please run the script in Git BASH.master@ircecho (2017/07) @swipesight (2018/09) @jaumard (2018/09) @nickmeinhold (2019/09) @athornz (2019/12) @amondnet (2019/12)