forked from loafle/openapi-generator-original
[dart] Fix enums with default value (#8182)
* simplify template expression
This commit is contained in:
@@ -2,7 +2,7 @@ class {{{classname}}} {
|
||||
/// Returns a new [{{{classname}}}] instance.
|
||||
{{{classname}}}({
|
||||
{{#vars}}
|
||||
{{#isNullable}}{{#required}}@required {{/required}}this.{{{name}}},{{/isNullable}}{{^isNullable}}{{#defaultValue}}this.{{{name}}} = {{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}{{#required}}@required {{/required}}this.{{{name}}}{{/defaultValue}},{{/isNullable}}
|
||||
{{#required}}{{^defaultValue}}@required {{/defaultValue}}{{/required}}this.{{{name}}}{{^isNullable}}{{#defaultValue}} = {{#isEnum}}{{^isContainer}}const {{{classname}}}{{{enumName}}}._({{/isContainer}}{{/isEnum}}{{{defaultValue}}}{{#isEnum}}{{^isContainer}}){{/isContainer}}{{/isEnum}}{{/defaultValue}}{{/isNullable}},
|
||||
{{/vars}}
|
||||
});
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class InlineObject2 {
|
||||
/// Returns a new [InlineObject2] instance.
|
||||
InlineObject2({
|
||||
this.enumFormStringArray = const [],
|
||||
this.enumFormString = '-efg',
|
||||
this.enumFormString = const InlineObject2EnumFormStringEnum._('-efg'),
|
||||
});
|
||||
|
||||
/// Form parameter enum test (string array)
|
||||
|
||||
Reference in New Issue
Block a user