diff --git a/modules/openapi-generator/src/main/resources/dart2/enum.mustache b/modules/openapi-generator/src/main/resources/dart2/enum.mustache index 87bbed91767..24ce94f0435 100644 --- a/modules/openapi-generator/src/main/resources/dart2/enum.mustache +++ b/modules/openapi-generator/src/main/resources/dart2/enum.mustache @@ -16,6 +16,10 @@ class {{classname}} { static {{classname}} fromJson({{dataType}} value) { return new {{classname}}TypeTransformer().decode(value); } + + static List<{{classname}}> listFromJson(List json) { + return json == null ? new List<{{classname}}>() : json.map((value) => {{classname}}.fromJson(value)).toList(); + } } class {{classname}}TypeTransformer {