From d14318cf257f94f64ff4b415115ba5970e110ae1 Mon Sep 17 00:00:00 2001 From: Adam Conway Date: Sun, 28 Jan 2018 19:31:47 +0200 Subject: [PATCH] [JAVA][Spring]Optional params with delegate (#7180) * Fixed data type for optional parameters in delegate When generating using the delegatePattern and including an optional parameter, the api used a type of Optional while the delegate used just T. This resulted in a java error in the generated code wen trying to call one from the other. Fixed by using correct data type in delegate Fix #7179 * Updated samples using supplied (Windows) scripts * Revert "Updated samples using supplied (Windows) scripts" This reverts commit 58b9c618085ac4201cfb011def96e14caaaff3f8. --- .../src/main/resources/JavaSpring/apiDelegate.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/apiDelegate.mustache index 482cdb1b2fb..cde9a5d81a6 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/apiDelegate.mustache @@ -61,7 +61,7 @@ public interface {{classname}}Delegate { /** * @see {{classname}}#{{operationId}} */ - {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}}{{{dataType}}}{{/isFile}}{{#isFile}}MultipartFile{{/isFile}} {{paramName}}{{#hasMore}}, + {{#jdk8}}default {{/jdk8}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{operationId}}({{#allParams}}{{^isFile}} {{>optionalDataType}} {{/isFile}}{{#isFile}}MultipartFile{{/isFile}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{^jdk8}};{{/jdk8}}{{#jdk8}} { if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { {{#examples}}