From c53e0c23a9e3914750b7e519c4bc337b783b8d3d Mon Sep 17 00:00:00 2001 From: Anthony Alves Date: Tue, 18 Sep 2018 19:53:17 -0400 Subject: [PATCH] dart: fix " issue in enums string enums need to generated with triple handlebars. https://github.com/swagger-api/swagger-codegen/pull/7418#issuecomment-360423456 --- .../src/main/resources/dart-jaguar/enum.mustache | 4 ++-- modules/swagger-codegen/src/main/resources/dart/enum.mustache | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/swagger-codegen/src/main/resources/dart-jaguar/enum.mustache b/modules/swagger-codegen/src/main/resources/dart-jaguar/enum.mustache index db68c114211e..8526ab15ec5a 100644 --- a/modules/swagger-codegen/src/main/resources/dart-jaguar/enum.mustache +++ b/modules/swagger-codegen/src/main/resources/dart-jaguar/enum.mustache @@ -12,7 +12,7 @@ class {{classname}} { {{#description}} /// {{description}} {{/description}} - static const {{classname}} {{name}} = const {{classname}}._internal({{value}}); + static const {{classname}} {{name}} = const {{classname}}._internal({{{value}}}); {{/enumVars}} {{/allowableValues}} } @@ -29,7 +29,7 @@ class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> { switch (data) { {{#allowableValues}} {{#enumVars}} - case {{value}}: return {{classname}}.{{name}}; + case {{{value}}}: return {{classname}}.{{name}}; {{/enumVars}} {{/allowableValues}} default: throw('Unknown enum value to decode: $data'); diff --git a/modules/swagger-codegen/src/main/resources/dart/enum.mustache b/modules/swagger-codegen/src/main/resources/dart/enum.mustache index debb73bbcec6..36f2e76ed923 100644 --- a/modules/swagger-codegen/src/main/resources/dart/enum.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/enum.mustache @@ -10,7 +10,7 @@ class {{classname}} { {{#description}} /// {{description}} {{/description}} - static const {{classname}} {{name}} = const {{classname}}._internal({{value}}); + static const {{classname}} {{name}} = const {{classname}}._internal({{{value}}}); {{/enumVars}} {{/allowableValues}} } @@ -27,7 +27,7 @@ class {{classname}}TypeTransformer extends TypeTransformer<{{classname}}> { switch (data) { {{#allowableValues}} {{#enumVars}} - case {{value}}: return {{classname}}.{{name}}; + case {{{value}}}: return {{classname}}.{{name}}; {{/enumVars}} {{/allowableValues}} default: throw('Unknown enum value to decode: $data');