From 54d9c19c7707285d7b3f9749762a5cf1a9c4336c Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 27 Feb 2019 23:26:53 +0800 Subject: [PATCH] Use https URL to download dependencies (#2248) * fix groovy default value, use https to download dep * update groovy build gradle file --- bin/kotlin-server-petstore.sh | 2 +- .../resources/Groovy/build.gradle.mustache | 17 ++++++------- .../src/main/resources/Groovy/model.mustache | 2 +- .../src/main/resources/finch/build.sbt | 6 ++--- .../libraries/ktor/build.gradle.mustache | 2 +- .../groovy/.openapi-generator/VERSION | 2 +- samples/client/petstore/groovy/build.gradle | 13 ++++------ .../groovy/org/openapitools/api/PetApi.groovy | 12 +++++----- .../org/openapitools/api/StoreApi.groovy | 6 ++--- .../org/openapitools/api/UserApi.groovy | 24 +++++++++---------- .../org/openapitools/model/Category.groovy | 4 ++-- .../model/ModelApiResponse.groovy | 6 ++--- .../org/openapitools/model/Order.groovy | 10 ++++---- .../groovy/org/openapitools/model/Pet.groovy | 6 ++--- .../groovy/org/openapitools/model/Tag.groovy | 4 ++-- .../groovy/org/openapitools/model/User.groovy | 16 ++++++------- .../petstore/kotlin-server/ktor/build.gradle | 2 +- 17 files changed, 64 insertions(+), 70 deletions(-) diff --git a/bin/kotlin-server-petstore.sh b/bin/kotlin-server-petstore.sh index ebca9d6078b..0cd2afebb6b 100755 --- a/bin/kotlin-server-petstore.sh +++ b/bin/kotlin-server-petstore.sh @@ -26,7 +26,7 @@ then fi # if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties -DdebugSupportingFiles=true" +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" ags="generate -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -t modules/openapi-generator/src/main/resources/kotlin-server -g kotlin-server --library=ktor -o samples/server/petstore/kotlin-server/ktor -DhideGenerationTimestamp=true $@" java ${JAVA_OPTS} -jar ${executable} ${ags} diff --git a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache index 5864228124d..ee7f2e16a7b 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache @@ -2,14 +2,13 @@ apply plugin: 'groovy' apply plugin: 'idea' apply plugin: 'eclipse' -def artifactory = 'buildserver.supportspace.com' -group = 'com.supportspace' +group = '{{groupId}}' +version = '{{artifactVersion}}' archivesBaseName = 'openapi-gen-groovy' -version = '0.1' buildscript { repositories { - maven { url 'http://repo.jfrog.org/artifactory/gradle-plugins' } + maven { url 'https://repo.jfrog.org/artifactory/gradle-plugins' } } dependencies { classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.16') @@ -19,14 +18,12 @@ buildscript { repositories { mavenCentral() mavenLocal() - mavenCentral(artifactUrls: ['http://maven.springframework.org/milestone']) - maven { url "http://$artifactory:8080/artifactory/repo" } } ext { - swagger_annotations_version = "1.5.21" + swagger_annotations_version = "1.5.22" jackson_version = "2.8.11" - jackson_databind_version = "2.8.11.2" + jackson_databind_version = "2.8.11.3" } dependencies { @@ -34,8 +31,8 @@ dependencies { compile "io.swagger:swagger-annotations:$swagger_annotations_version" compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" - compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" - compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_databind_version" + compile "com.fasterxml.jackson.core:jackson-databind:$jackson_databind_version" + compile "com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:$jackson_version" compile "com.fasterxml.jackson.datatype:jackson-datatype-joda:2.1.5" compile 'org.codehaus.groovy.modules.http-builder:http-builder:0.7.1' } diff --git a/modules/openapi-generator/src/main/resources/Groovy/model.mustache b/modules/openapi-generator/src/main/resources/Groovy/model.mustache index 9e23c93ee1e..07c0405c98c 100644 --- a/modules/openapi-generator/src/main/resources/Groovy/model.mustache +++ b/modules/openapi-generator/src/main/resources/Groovy/model.mustache @@ -13,7 +13,7 @@ class {{classname}} { {{#description}} /* {{{description}}} */ {{/description}} - {{{dataType}}} {{name}} = {{{defaultValue}}} + {{{dataType}}} {{name}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} {{/vars}} } diff --git a/modules/openapi-generator/src/main/resources/finch/build.sbt b/modules/openapi-generator/src/main/resources/finch/build.sbt index 282a54185b6..de479d2ca1f 100644 --- a/modules/openapi-generator/src/main/resources/finch/build.sbt +++ b/modules/openapi-generator/src/main/resources/finch/build.sbt @@ -10,13 +10,13 @@ scalaVersion := "2.12.3" resolvers += Resolver.sonatypeRepo("snapshots") -resolvers += "TM" at "http://maven.twttr.com" +resolvers += "TM" at "https://maven.twttr.com" resolvers += "Local Maven Repository" at "file://"+Path.userHome.absolutePath+"/.m2/repository" -resolvers += "Sonatype OSS Snapshots" at "http://oss.sonatype.org/content/repositories/snapshots/" +resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots/" -resolvers += "Sonatype OSS Releases" at "http://oss.sonatype.org/content/repositories/releases/" +resolvers += "Sonatype OSS Releases" at "https://oss.sonatype.org/content/repositories/releases/" Defaults.itSettings diff --git a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache index 494ea0e76f5..7f86e1dc138 100644 --- a/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache +++ b/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache @@ -57,7 +57,7 @@ shadowJar { repositories { mavenCentral() - maven { url "http://dl.bintray.com/kotlin/ktor" } + maven { url "https://dl.bintray.com/kotlin/ktor" } maven { url "https://dl.bintray.com/kotlin/kotlinx" } } diff --git a/samples/client/petstore/groovy/.openapi-generator/VERSION b/samples/client/petstore/groovy/.openapi-generator/VERSION index 096bf47efe3..afa63656064 100644 --- a/samples/client/petstore/groovy/.openapi-generator/VERSION +++ b/samples/client/petstore/groovy/.openapi-generator/VERSION @@ -1 +1 @@ -3.0.0-SNAPSHOT \ No newline at end of file +4.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/groovy/build.gradle b/samples/client/petstore/groovy/build.gradle index a95db7cb74b..30b440b4dd4 100644 --- a/samples/client/petstore/groovy/build.gradle +++ b/samples/client/petstore/groovy/build.gradle @@ -2,14 +2,13 @@ apply plugin: 'groovy' apply plugin: 'idea' apply plugin: 'eclipse' -def artifactory = 'buildserver.supportspace.com' -group = 'com.supportspace' +group = 'org.openapitools' +version = '1.0.0' archivesBaseName = 'openapi-gen-groovy' -version = '0.1' buildscript { repositories { - maven { url 'http://repo.jfrog.org/artifactory/gradle-plugins' } + maven { url 'https://repo.jfrog.org/artifactory/gradle-plugins' } } dependencies { classpath(group: 'org.jfrog.buildinfo', name: 'build-info-extractor-gradle', version: '2.0.16') @@ -19,14 +18,12 @@ buildscript { repositories { mavenCentral() mavenLocal() - mavenCentral(artifactUrls: ['http://maven.springframework.org/milestone']) - maven { url "http://$artifactory:8080/artifactory/repo" } } ext { - swagger_annotations_version = "1.5.21" + swagger_annotations_version = "1.5.22" jackson_version = "2.8.11" - jackson_databind_version = "2.8.11.2" + jackson_databind_version = "2.8.11.3" } dependencies { diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy index f6ce617fe76..4dd50a1b29f 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/PetApi.groovy @@ -15,7 +15,7 @@ class PetApi { String basePath = "http://petstore.swagger.io/v2" String versionPath = "/api/v1" - def addPet ( Pet pet, Closure onSuccess, Closure onFailure) { + def addPet ( Pet body, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/pet" @@ -24,8 +24,8 @@ class PetApi { def headerParams = [:] // verify required params are set - if (pet == null) { - throw new RuntimeException("missing required params pet") + if (body == null) { + throw new RuntimeException("missing required params body") } // TODO: form params, body param not yet support @@ -128,7 +128,7 @@ class PetApi { } - def updatePet ( Pet pet, Closure onSuccess, Closure onFailure) { + def updatePet ( Pet body, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/pet" @@ -137,8 +137,8 @@ class PetApi { def headerParams = [:] // verify required params are set - if (pet == null) { - throw new RuntimeException("missing required params pet") + if (body == null) { + throw new RuntimeException("missing required params body") } // TODO: form params, body param not yet support diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy index 02aa6c91137..0650a7232b1 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/StoreApi.groovy @@ -72,7 +72,7 @@ class StoreApi { } - def placeOrder ( Order order, Closure onSuccess, Closure onFailure) { + def placeOrder ( Order body, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/store/order" @@ -81,8 +81,8 @@ class StoreApi { def headerParams = [:] // verify required params are set - if (order == null) { - throw new RuntimeException("missing required params order") + if (body == null) { + throw new RuntimeException("missing required params body") } // TODO: form params, body param not yet support diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy index 3097056a62c..0c768494640 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/api/UserApi.groovy @@ -14,7 +14,7 @@ class UserApi { String basePath = "http://petstore.swagger.io/v2" String versionPath = "/api/v1" - def createUser ( User user, Closure onSuccess, Closure onFailure) { + def createUser ( User body, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/user" @@ -23,8 +23,8 @@ class UserApi { def headerParams = [:] // verify required params are set - if (user == null) { - throw new RuntimeException("missing required params user") + if (body == null) { + throw new RuntimeException("missing required params body") } // TODO: form params, body param not yet support @@ -35,7 +35,7 @@ class UserApi { } - def createUsersWithArrayInput ( List user, Closure onSuccess, Closure onFailure) { + def createUsersWithArrayInput ( List body, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/user/createWithArray" @@ -44,8 +44,8 @@ class UserApi { def headerParams = [:] // verify required params are set - if (user == null) { - throw new RuntimeException("missing required params user") + if (body == null) { + throw new RuntimeException("missing required params body") } // TODO: form params, body param not yet support @@ -56,7 +56,7 @@ class UserApi { } - def createUsersWithListInput ( List user, Closure onSuccess, Closure onFailure) { + def createUsersWithListInput ( List body, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/user/createWithList" @@ -65,8 +65,8 @@ class UserApi { def headerParams = [:] // verify required params are set - if (user == null) { - throw new RuntimeException("missing required params user") + if (body == null) { + throw new RuntimeException("missing required params body") } // TODO: form params, body param not yet support @@ -167,7 +167,7 @@ class UserApi { } - def updateUser ( String username, User user, Closure onSuccess, Closure onFailure) { + def updateUser ( String username, User body, Closure onSuccess, Closure onFailure) { // create path and map path parameters (TODO) String resourcePath = "/user/{username}" @@ -181,8 +181,8 @@ class UserApi { } // verify required params are set - if (user == null) { - throw new RuntimeException("missing required params user") + if (body == null) { + throw new RuntimeException("missing required params body") } // TODO: form params, body param not yet support diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Category.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Category.groovy index 3ba8a6372ef..305a861bd28 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Category.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Category.groovy @@ -6,8 +6,8 @@ import io.swagger.annotations.ApiModelProperty; @Canonical class Category { - Long id = null + Long id - String name = null + String name } diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/ModelApiResponse.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/ModelApiResponse.groovy index 6a1824fa406..9a1f4fe1680 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/ModelApiResponse.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/ModelApiResponse.groovy @@ -6,10 +6,10 @@ import io.swagger.annotations.ApiModelProperty; @Canonical class ModelApiResponse { - Integer code = null + Integer code - String type = null + String type - String message = null + String message } diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Order.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Order.groovy index 14b3ae47ed6..6bbffdbd7c9 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Order.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Order.groovy @@ -6,16 +6,16 @@ import io.swagger.annotations.ApiModelProperty; @Canonical class Order { - Long id = null + Long id - Long petId = null + Long petId - Integer quantity = null + Integer quantity - Date shipDate = null + Date shipDate /* Order Status */ - String status = null + String status Boolean complete = false diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy index f0eb4ddef4c..eb62fc15ff3 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Pet.groovy @@ -10,17 +10,17 @@ import org.openapitools.model.Tag; @Canonical class Pet { - Long id = null + Long id Category category = null - String name = null + String name List photoUrls = new ArrayList() List tags = new ArrayList() /* pet status in the store */ - String status = null + String status } diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Tag.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Tag.groovy index 3c3d77c8261..64f08ade6a4 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Tag.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/Tag.groovy @@ -6,8 +6,8 @@ import io.swagger.annotations.ApiModelProperty; @Canonical class Tag { - Long id = null + Long id - String name = null + String name } diff --git a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/User.groovy b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/User.groovy index 6d9d2308dee..ed6ebe83392 100644 --- a/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/User.groovy +++ b/samples/client/petstore/groovy/src/main/groovy/org/openapitools/model/User.groovy @@ -6,21 +6,21 @@ import io.swagger.annotations.ApiModelProperty; @Canonical class User { - Long id = null + Long id - String username = null + String username - String firstName = null + String firstName - String lastName = null + String lastName - String email = null + String email - String password = null + String password - String phone = null + String phone /* User Status */ - Integer userStatus = null + Integer userStatus } diff --git a/samples/server/petstore/kotlin-server/ktor/build.gradle b/samples/server/petstore/kotlin-server/ktor/build.gradle index 8b69310bdc4..345a249b122 100644 --- a/samples/server/petstore/kotlin-server/ktor/build.gradle +++ b/samples/server/petstore/kotlin-server/ktor/build.gradle @@ -57,7 +57,7 @@ shadowJar { repositories { mavenCentral() - maven { url "http://dl.bintray.com/kotlin/ktor" } + maven { url "https://dl.bintray.com/kotlin/ktor" } maven { url "https://dl.bintray.com/kotlin/kotlinx" } }