Skip to content

Commit

Permalink
remove leading space
Browse files Browse the repository at this point in the history
  • Loading branch information
karismann committed May 17, 2019
1 parent 59eadba commit 6551a08
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ public JavaJAXRSSpecServerCodegen() {
updateOption(CodegenConstants.ARTIFACT_ID, this.getArtifactId());
updateOption(CodegenConstants.API_PACKAGE, apiPackage);
updateOption(CodegenConstants.MODEL_PACKAGE, modelPackage);
removeOption(CodegenConstants.LIBRARY);

modelTemplateFiles.put("model.mustache", ".java");
apiTemplateFiles.put("api.mustache", ".java");
Expand All @@ -81,6 +80,7 @@ public JavaJAXRSSpecServerCodegen() {

super.embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "spec";

removeOption(CodegenConstants.LIBRARY);
CliOption library = new CliOption(CodegenConstants.LIBRARY, CodegenConstants.LIBRARY_DESC).defaultValue(DEFAULT_LIBRARY);
Map<String, String> supportedLibraries = new LinkedHashMap<>();
supportedLibraries.put(DEFAULT_LIBRARY, "JAXRS");
Expand Down
10 changes: 7 additions & 3 deletions modules/openapi-generator/src/main/resources/Groovy/api.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ class {{classname}} {
def bodyParams
def contentType
{{#allParams}}{{#required}}
{{#allParams}}
{{#required}}
// verify required params are set
if ({{paramName}} == null) {
throw new RuntimeException("missing required params {{paramName}}")
}
{{/required}}{{/allParams}}
{{/required}}
{{/allParams}}

{{#queryParams}}
if ({{paramName}} != null) {
Expand Down Expand Up @@ -53,7 +55,9 @@ class {{classname}} {
{{/hasMore}}
{{#hasMore}}
bodyParams = [:]
bodyParams.put("{{baseName}}", {{paramName}}){{/hasMore}}{{/bodyParams.0}}
bodyParams.put("{{baseName}}", {{paramName}})
{{/hasMore}}
{{/bodyParams.0}}
{{#bodyParams}}
{{#secondaryParam}}
bodyParams.put("{{baseName}}", {{paramName}})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,17 @@ class PetApi {
def bodyParams
def contentType


// verify required params are set
if (body == null) {
throw new RuntimeException("missing required params body")
}




contentType = 'application/json';
bodyParams = body



apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
"POST", "",
null )
Expand All @@ -47,12 +44,10 @@ class PetApi {
def bodyParams
def contentType


// verify required params are set
if (petId == null) {
throw new RuntimeException("missing required params petId")
}



if (apiKey != null) {
Expand All @@ -61,7 +56,6 @@ class PetApi {




apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
"DELETE", "",
null )
Expand All @@ -77,12 +71,10 @@ class PetApi {
def bodyParams
def contentType


// verify required params are set
if (status == null) {
throw new RuntimeException("missing required params status")
}


if (status != null) {
queryParams.put("status", status)
Expand All @@ -91,7 +83,6 @@ class PetApi {




apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
"GET", "array",
Pet.class )
Expand All @@ -107,12 +98,10 @@ class PetApi {
def bodyParams
def contentType


// verify required params are set
if (tags == null) {
throw new RuntimeException("missing required params tags")
}


if (tags != null) {
queryParams.put("tags", tags)
Expand All @@ -121,7 +110,6 @@ class PetApi {




apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
"GET", "array",
Pet.class )
Expand All @@ -137,13 +125,10 @@ class PetApi {
def bodyParams
def contentType


// verify required params are set
if (petId == null) {
throw new RuntimeException("missing required params petId")
}





Expand All @@ -164,20 +149,17 @@ class PetApi {
def bodyParams
def contentType


// verify required params are set
if (body == null) {
throw new RuntimeException("missing required params body")
}




contentType = 'application/json';
bodyParams = body



apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
"PUT", "",
null )
Expand All @@ -193,13 +175,10 @@ class PetApi {
def bodyParams
def contentType


// verify required params are set
if (petId == null) {
throw new RuntimeException("missing required params petId")
}





Expand All @@ -224,13 +203,10 @@ class PetApi {
def bodyParams
def contentType


// verify required params are set
if (petId == null) {
throw new RuntimeException("missing required params petId")
}





Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ class StoreApi {
def bodyParams
def contentType


// verify required params are set
if (orderId == null) {
throw new RuntimeException("missing required params orderId")
}





Expand All @@ -44,8 +41,6 @@ class StoreApi {
def bodyParams
def contentType






Expand All @@ -66,13 +61,10 @@ class StoreApi {
def bodyParams
def contentType


// verify required params are set
if (orderId == null) {
throw new RuntimeException("missing required params orderId")
}





Expand All @@ -93,20 +85,17 @@ class StoreApi {
def bodyParams
def contentType


// verify required params are set
if (body == null) {
throw new RuntimeException("missing required params body")
}




contentType = 'application/json';
bodyParams = body



apiUtils.invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, bodyParams, contentType,
"POST", "",
Order.class )
Expand Down
Loading

0 comments on commit 6551a08

Please sign in to comment.