diff --git a/.gitignore b/.gitignore index 9e0a0947328..88294062533 100644 --- a/.gitignore +++ b/.gitignore @@ -188,3 +188,6 @@ cabal.project.local samples/client/petstore/elixir/_build/ samples/client/petstore/elixir/deps/ samples/client/petstore/elixir/mix.lock + +# groovy +samples/client/petstore/groovy/build diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java index 4aad686a9bf..607ccbee70c 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/GroovyClientCodegen.java @@ -12,9 +12,11 @@ public class GroovyClientCodegen extends AbstractJavaCodegen { public GroovyClientCodegen() { super(); - // clear import mapping (from default generator) as groovy does not use it - // at the moment - importMapping.clear(); + // avoid importing the following as models + languageSpecificPrimitives.add("Date"); + languageSpecificPrimitives.add("ArrayList"); + languageSpecificPrimitives.add("File"); + languageSpecificPrimitives.add("Map"); sourceFolder = projectFolder + File.separator + "groovy"; outputFolder = "generated-code/groovy"; @@ -29,18 +31,17 @@ public class GroovyClientCodegen extends AbstractJavaCodegen { modelDocTemplateFiles.remove("model_doc.mustache"); apiDocTemplateFiles.remove("api_doc.mustache"); - apiPackage = "io.swagger.api"; - modelPackage = "io.swagger.model"; - configPackage = "io.swagger.configuration"; - invokerPackage = "io.swagger.api"; - artifactId = "swagger-groovy"; + apiPackage = "org.openapitools.api"; + modelPackage = "org.openapitools.model"; + configPackage = "org.openapitools.configuration"; + invokerPackage = "org.openapitools.api"; + artifactId = "openapi-groovy"; dateLibrary = "legacy"; //TODO: add joda support to groovy additionalProperties.put("title", title); additionalProperties.put(CONFIG_PACKAGE, configPackage); cliOptions.add(new CliOption(CONFIG_PACKAGE, "configuration package for generated code")); - } @Override diff --git a/modules/openapi-generator/src/main/resources/Groovy/model.mustache b/modules/openapi-generator/src/main/resources/Groovy/model.mustache index 4a355ebb1e1..2c80afe95f2 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/model.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/model.mustache @@ -18,4 +18,4 @@ class {{classname}} { {{/vars}} } {{/model}} -{{/models}} \ No newline at end of file +{{/models}} diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 7fea99011a6..096bf47efe3 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -2.2.3-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/ApiUtils.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/ApiUtils.groovy similarity index 98% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/api/ApiUtils.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/ApiUtils.groovy index 877ed4e4647..0e3473e879f 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/ApiUtils.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/ApiUtils.groovy @@ -1,4 +1,4 @@ -package io.swagger.api; +package org.openapitools.api; import groovyx.net.http.HTTPBuilder import groovyx.net.http.Method diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy similarity index 97% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy index 2620b4e776b..f6ce617fe76 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/PetApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy @@ -1,13 +1,12 @@ -package io.swagger.api; +package org.openapitools.api; import groovyx.net.http.* import static groovyx.net.http.ContentType.* import static groovyx.net.http.Method.* -import io.swagger.api.ApiUtils +import org.openapitools.api.ApiUtils -import io.swagger.model.File -import io.swagger.model.ModelApiResponse -import io.swagger.model.Pet +import org.openapitools.model.ModelApiResponse +import org.openapitools.model.Pet import java.util.*; diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy similarity index 96% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy index 1d0687f9f21..02aa6c91137 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/StoreApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy @@ -1,12 +1,11 @@ -package io.swagger.api; +package org.openapitools.api; import groovyx.net.http.* import static groovyx.net.http.ContentType.* import static groovyx.net.http.Method.* -import io.swagger.api.ApiUtils +import org.openapitools.api.ApiUtils -import io.swagger.model.Map -import io.swagger.model.Order +import org.openapitools.model.Order import java.util.*; diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy similarity index 98% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy index b4520626564..3097056a62c 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/api/UserApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy @@ -1,11 +1,11 @@ -package io.swagger.api; +package org.openapitools.api; import groovyx.net.http.* import static groovyx.net.http.ContentType.* import static groovyx.net.http.Method.* -import io.swagger.api.ApiUtils +import org.openapitools.api.ApiUtils -import io.swagger.model.User +import org.openapitools.model.User import java.util.*; diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Category.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Category.groovy similarity index 86% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Category.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Category.groovy index 2081516261e..3ba8a6372ef 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Category.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Category.groovy @@ -1,4 +1,4 @@ -package io.swagger.model; +package org.openapitools.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/ModelApiResponse.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/ModelApiResponse.groovy similarity index 88% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/model/ModelApiResponse.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/ModelApiResponse.groovy index c6f8fd27192..6a1824fa406 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/ModelApiResponse.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/ModelApiResponse.groovy @@ -1,4 +1,4 @@ -package io.swagger.model; +package org.openapitools.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Order.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Order.groovy similarity index 85% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Order.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Order.groovy index 4a7a3aa1b9f..14b3ae47ed6 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Order.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Order.groovy @@ -1,9 +1,8 @@ -package io.swagger.model; +package org.openapitools.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.swagger.model.Date; @Canonical class Order { diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Pet.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy similarity index 74% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Pet.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy index 9fb4d6e51b9..f0eb4ddef4c 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Pet.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy @@ -1,12 +1,12 @@ -package io.swagger.model; +package org.openapitools.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.swagger.model.ArrayList; -import io.swagger.model.Category; -import io.swagger.model.Tag; +import java.util.ArrayList; import java.util.List; +import org.openapitools.model.Category; +import org.openapitools.model.Tag; @Canonical class Pet { diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Tag.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Tag.groovy similarity index 85% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Tag.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Tag.groovy index 5b513a987bd..3c3d77c8261 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/Tag.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Tag.groovy @@ -1,4 +1,4 @@ -package io.swagger.model; +package org.openapitools.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; diff --git a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/User.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/User.groovy similarity index 92% rename from samples/client/petstore/groovy/src/main/groovy/io/swagger/model/User.groovy rename to samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/User.groovy index 8fbe2e18a5a..6d9d2308dee 100644 --- a/samples/client/petstore/groovy/src/main/groovy/io/swagger/model/User.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/User.groovy @@ -1,4 +1,4 @@ -package io.swagger.model; +package org.openapitools.model; import groovy.transform.Canonical import io.swagger.annotations.ApiModel; diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/api/ApiUtils.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/api/ApiUtils.groovy deleted file mode 100644 index 877ed4e4647..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/api/ApiUtils.groovy +++ /dev/null @@ -1,50 +0,0 @@ -package io.swagger.api; - -import groovyx.net.http.HTTPBuilder -import groovyx.net.http.Method - -import static groovyx.net.http.ContentType.JSON -import static java.net.URI.create; - -class ApiUtils { - - def invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, method, container, type) { - def (url, uriPath) = buildUrlAndUriPath(basePath, versionPath, resourcePath) - println "url=$url uriPath=$uriPath" - def http = new HTTPBuilder(url) - http.request( Method.valueOf(method), JSON ) { - uri.path = uriPath - uri.query = queryParams - response.success = { resp, json -> - if (type != null) { - onSuccess(parse(json, container, type)) - } - } - response.failure = { resp -> - onFailure(resp.status, resp.statusLine.reasonPhrase) - } - } - } - - - def buildUrlAndUriPath(basePath, versionPath, resourcePath) { - // HTTPBuilder expects to get as its constructor parameter an URL, - // without any other additions like path, therefore we need to cut the path - // from the basePath as it is represented by swagger APIs - // we use java.net.URI to manipulate the basePath - // then the uriPath will hold the rest of the path - URI baseUri = create(basePath) - def pathOnly = baseUri.getPath() - [basePath-pathOnly, pathOnly+versionPath+resourcePath] - } - - - def parse(object, container, clazz) { - if (container == "List") { - return object.collect {parse(it, "", clazz)} - } else { - return clazz.newInstance(object) - } - } - -} diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/api/PetApi.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/api/PetApi.groovy deleted file mode 100644 index a8b0bebeedc..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/api/PetApi.groovy +++ /dev/null @@ -1,218 +0,0 @@ -package io.swagger.api; - - - - - -import groovyx.net.http.* -import static groovyx.net.http.ContentType.* -import static groovyx.net.http.Method.* -import io.swagger.api.ApiUtils -//------------- - -import io.swagger.model.Pet -import java.io.File -import io.swagger.model.ModelApiResponse - -import java.util.*; - -@Mixin(ApiUtils) -class PetApi { - String basePath = "http://petstore.swagger.io/v2" - String versionPath = "/api/v1" - - - def addPet ( Pet body, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "POST", "", - null ) - - } - def deletePet ( Long petId, String apiKey, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/{petId}" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if( // verify required params are set - if() { - throw new RuntimeException("missing required params") - } -) { - throw new RuntimeException("missing required params") - } - - - headerParams.put("apiKey", apiKey) - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "DELETE", "", - null ) - - } - def findPetsByStatus ( List status, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/findByStatus" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - if(!"null".equals(String.valueOf(status))) - queryParams.put("status", String.valueOf(status)) - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "GET", "List", - Pet.class ) - - } - def findPetsByTags ( List tags, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/findByTags" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - if(!"null".equals(String.valueOf(tags))) - queryParams.put("tags", String.valueOf(tags)) - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "GET", "List", - Pet.class ) - - } - def getPetById ( Long petId, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/{petId}" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "GET", "", - Pet.class ) - - } - def updatePet ( Pet body, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "PUT", "", - null ) - - } - def updatePetWithForm ( Long petId, String name, String status, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/{petId}" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if( // verify required params are set - if( // verify required params are set - if() { - throw new RuntimeException("missing required params") - } -) { - throw new RuntimeException("missing required params") - } -) { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "POST", "", - null ) - - } - def uploadFile ( Long petId, String additionalMetadata, File file, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/{petId}/uploadImage" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if( // verify required params are set - if( // verify required params are set - if() { - throw new RuntimeException("missing required params") - } -) { - throw new RuntimeException("missing required params") - } -) { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "POST", "", - ModelApiResponse.class ) - - } -} diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/api/StoreApi.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/api/StoreApi.groovy deleted file mode 100644 index 681000fbcdb..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/api/StoreApi.groovy +++ /dev/null @@ -1,104 +0,0 @@ -package io.swagger.api; - - - - - -import groovyx.net.http.* -import static groovyx.net.http.ContentType.* -import static groovyx.net.http.Method.* -import io.swagger.api.ApiUtils -//------------- - -import java.util.Map -import io.swagger.model.Order - -import java.util.*; - -@Mixin(ApiUtils) -class StoreApi { - String basePath = "http://petstore.swagger.io/v2" - String versionPath = "/api/v1" - - - def deleteOrder ( String orderId, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/order/{orderId}" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "DELETE", "", - null ) - - } - def getInventory ( Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/inventory" - - - // query params - def queryParams = [:] - def headerParams = [:] - - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "GET", "Map", - Map.class ) - - } - def getOrderById ( Long orderId, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/order/{orderId}" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "GET", "", - Order.class ) - - } - def placeOrder ( Order body, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/order" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "POST", "", - Order.class ) - - } -} diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/api/UserApi.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/api/UserApi.groovy deleted file mode 100644 index 033057a08eb..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/api/UserApi.groovy +++ /dev/null @@ -1,200 +0,0 @@ -package io.swagger.api; - - - - - -import groovyx.net.http.* -import static groovyx.net.http.ContentType.* -import static groovyx.net.http.Method.* -import io.swagger.api.ApiUtils -//------------- - -import io.swagger.model.User -import java.util.List - -import java.util.*; - -@Mixin(ApiUtils) -class UserApi { - String basePath = "http://petstore.swagger.io/v2" - String versionPath = "/api/v1" - - - def createUser ( User body, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "POST", "", - null ) - - } - def createUsersWithArrayInput ( List body, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/createWithArray" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "POST", "", - null ) - - } - def createUsersWithListInput ( List body, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/createWithList" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "POST", "", - null ) - - } - def deleteUser ( String username, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/{username}" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "DELETE", "", - null ) - - } - def getUserByName ( String username, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/{username}" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if() { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "GET", "", - User.class ) - - } - def loginUser ( String username, String password, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/login" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if( // verify required params are set - if() { - throw new RuntimeException("missing required params") - } -) { - throw new RuntimeException("missing required params") - } - - if(!"null".equals(String.valueOf(username))) - queryParams.put("username", String.valueOf(username)) -if(!"null".equals(String.valueOf(password))) - queryParams.put("password", String.valueOf(password)) - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "GET", "", - String.class ) - - } - def logoutUser ( Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/logout" - - - // query params - def queryParams = [:] - def headerParams = [:] - - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "GET", "", - null ) - - } - def updateUser ( String username, User body, Closure onSuccess, Closure onFailure) { - // create path and map variables - String resourcePath = "/{username}" - - - // query params - def queryParams = [:] - def headerParams = [:] - - // verify required params are set - if( // verify required params are set - if() { - throw new RuntimeException("missing required params") - } -) { - throw new RuntimeException("missing required params") - } - - - - invokeApi(onSuccess, onFailure, basePath, versionPath, resourcePath, queryParams, headerParams, - "PUT", "", - null ) - - } -} diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/model/Category.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/model/Category.groovy deleted file mode 100644 index 29509e64e54..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/model/Category.groovy +++ /dev/null @@ -1,16 +0,0 @@ -package io.swagger.model; - -import groovy.transform.Canonical -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -@Canonical -class Category { - - Long id = null - - String name = null - - -} - diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/model/ModelApiResponse.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/model/ModelApiResponse.groovy deleted file mode 100644 index 505752a6dc3..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/model/ModelApiResponse.groovy +++ /dev/null @@ -1,18 +0,0 @@ -package io.swagger.model; - -import groovy.transform.Canonical -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -@Canonical -class ModelApiResponse { - - Integer code = null - - String type = null - - String message = null - - -} - diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/model/Order.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/model/Order.groovy deleted file mode 100644 index 815c72846d9..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/model/Order.groovy +++ /dev/null @@ -1,27 +0,0 @@ -package io.swagger.model; - -import groovy.transform.Canonical -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.Date; -@Canonical -class Order { - - Long id = null - - Long petId = null - - Integer quantity = null - - Date shipDate = null - - /* Order Status */ - String status = null - - Boolean complete = false - - -} - diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/model/Pet.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/model/Pet.groovy deleted file mode 100644 index 667ce9430f4..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/model/Pet.groovy +++ /dev/null @@ -1,30 +0,0 @@ -package io.swagger.model; - -import groovy.transform.Canonical -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.model.Category; -import io.swagger.model.Tag; -import java.util.ArrayList; -import java.util.List; -@Canonical -class Pet { - - Long id = null - - Category category = null - - String name = null - - List photoUrls = new ArrayList() - - List tags = new ArrayList() - - /* pet status in the store */ - String status = null - - -} - diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/model/Tag.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/model/Tag.groovy deleted file mode 100644 index 5c30c04a5ff..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/model/Tag.groovy +++ /dev/null @@ -1,16 +0,0 @@ -package io.swagger.model; - -import groovy.transform.Canonical -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -@Canonical -class Tag { - - Long id = null - - String name = null - - -} - diff --git a/samples/client/petstore/groovy/src/main/java/io/swagger/model/User.groovy b/samples/client/petstore/groovy/src/main/java/io/swagger/model/User.groovy deleted file mode 100644 index 6889661e9e5..00000000000 --- a/samples/client/petstore/groovy/src/main/java/io/swagger/model/User.groovy +++ /dev/null @@ -1,29 +0,0 @@ -package io.swagger.model; - -import groovy.transform.Canonical -import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -@Canonical -class User { - - Long id = null - - String username = null - - String firstName = null - - String lastName = null - - String email = null - - String password = null - - String phone = null - - /* User Status */ - Integer userStatus = null - - -} -