Skip to content

Commit

Permalink
Add listFromJson method to fix OpenAPITools#4887
Browse files Browse the repository at this point in the history
  • Loading branch information
selankon committed Feb 17, 2020
1 parent ce997a1 commit 95f60e4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class {{classname}} {
static {{classname}} fromJson(String value) {
return new {{classname}}TypeTransformer().decode(value);
}

static List<{{classname}}> listFromJson(List<dynamic> json) {
return json == null ? new List<{{classname}}>() : json.map((value) => {{classname}}.fromJson(value)).toList();
}
}

class {{classname}}TypeTransformer {
Expand Down

0 comments on commit 95f60e4

Please sign in to comment.