Skip to content

Commit 942035a

Browse files
authored
Create method to json (#6111)
1 parent 2dd5477 commit 942035a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/openapi-generator/src/main/resources/dart2/enum.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ class {{classname}} {
1212
static const {{classname}} {{{name}}} = const {{classname}}._internal({{{value}}});
1313
{{/enumVars}}
1414
{{/allowableValues}}
15+
16+
{{dataType}} toJson (){
17+
return this.value;
18+
}
1519

1620
static {{classname}} fromJson({{dataType}} value) {
1721
return new {{classname}}TypeTransformer().decode(value);

0 commit comments

Comments
 (0)