forked from loafle/openapi-generator-original
[Java Play Framework] Fix to the default values (#5879)
* Fix to the default values. It did not take care of the "default" and also was setting to a bad default when not set. * Just make a difference between string and non string instead of placing all types in the mustache file
This commit is contained in:
parent
a2d19a1feb
commit
bf74de3a5a
@ -1 +1 @@
|
||||
{{#isBoolean}}false{{/isBoolean}}{{#isInteger}}0{{/isInteger}}{{#isDouble}}0.0{{/isDouble}}{{#isLong}}0L{{/isLong}}{{#isFloat}}0.0{{/isFloat}}{{#isString}}""{{/isString}}
|
||||
{{#defaultValue}}{{#isString}}"{{/isString}}{{{defaultValue}}}{{#isString}}"{{/isString}}{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user