From 36e94f7ed1dfdfe99f0061c0f79b48f1ad33c0e9 Mon Sep 17 00:00:00 2001 From: Marcin Stefaniuk Date: Mon, 23 May 2016 13:40:12 +0200 Subject: [PATCH] Enumerations on api input. --- modules/swagger-codegen/src/main/resources/nancyfx/api.mustache | 2 +- .../src/main/resources/nancyfx/innerApiEnum.mustache | 2 +- .../src/main/resources/nancyfx/paramsList.mustache | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 modules/swagger-codegen/src/main/resources/nancyfx/paramsList.mustache diff --git a/modules/swagger-codegen/src/main/resources/nancyfx/api.mustache b/modules/swagger-codegen/src/main/resources/nancyfx/api.mustache index af38d53a409..8a35443f3d4 100644 --- a/modules/swagger-codegen/src/main/resources/nancyfx/api.mustache +++ b/modules/swagger-codegen/src/main/resources/nancyfx/api.mustache @@ -35,7 +35,7 @@ namespace {{packageName}}.Module public interface {{classname}}Service { {{#operation}} - {{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{#allParams}}{{&dataType}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); + {{#returnType}}{{&returnType}}{{/returnType}}{{^returnType}}void{{/returnType}} {{operationId}}({{>paramsList}}); {{/operation}} } diff --git a/modules/swagger-codegen/src/main/resources/nancyfx/innerApiEnum.mustache b/modules/swagger-codegen/src/main/resources/nancyfx/innerApiEnum.mustache index dbc72cb97e0..33e93bdd34b 100644 --- a/modules/swagger-codegen/src/main/resources/nancyfx/innerApiEnum.mustache +++ b/modules/swagger-codegen/src/main/resources/nancyfx/innerApiEnum.mustache @@ -1 +1 @@ -public enum {{#datatypeWithEnum}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#values}}{{&.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} }; \ No newline at end of file +public enum {{#datatypeWithEnum}}{{operationId}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} { {{#allowableValues}}{{#values}}{{&.}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}} }; \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/nancyfx/paramsList.mustache b/modules/swagger-codegen/src/main/resources/nancyfx/paramsList.mustache new file mode 100644 index 00000000000..75e21010c73 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/nancyfx/paramsList.mustache @@ -0,0 +1 @@ +{{#allParams}}{{#isEnum}}{{#datatypeWithEnum}}{{operationId}}{{.}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}{{/isEnum}}{{^isEnum}}{{dataType}}{{/isEnum}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}} \ No newline at end of file