diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache index 733d31a6d72..a5587249639 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/paramDefaultValue.mustache @@ -1 +1 @@ -{{#isBoolean}}false{{/isBoolean}}{{#isInteger}}0{{/isInteger}}{{#isDouble}}0.0{{/isDouble}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0{{/isFloat}}{{#isString}}""{{/isString}} \ No newline at end of file +{{#defaultValue}}{{#isString}}"{{/isString}}{{{defaultValue}}}{{#isString}}"{{/isString}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}} \ No newline at end of file diff --git a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java index 4ee0a235890..c36fe77e3dd 100644 --- a/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java +++ b/samples/server/petstore/java-play-framework/app/controllers/PetApiController.java @@ -53,7 +53,7 @@ public class PetApiController extends Controller { apiKey = (String)valueapiKey; } else { - apiKey = ""; + apiKey = null; } imp.deletePet(petId, apiKey); @@ -116,7 +116,7 @@ public class PetApiController extends Controller { name = (String)valuename; } else { - name = ""; + name = null; } String valuestatus = (request().body().asMultipartFormData().asFormUrlEncoded().get("status"))[0]; String status; @@ -124,7 +124,7 @@ public class PetApiController extends Controller { status = (String)valuestatus; } else { - status = ""; + status = null; } imp.updatePetWithForm(petId, name, status); @@ -139,7 +139,7 @@ public class PetApiController extends Controller { additionalMetadata = (String)valueadditionalMetadata; } else { - additionalMetadata = ""; + additionalMetadata = null; } Http.MultipartFormData.FilePart file = request().body().asMultipartFormData().getFile("file"); ModelApiResponse obj = imp.uploadFile(petId, additionalMetadata, file);