Change default package name value for kotlin client (#382)

* Move pom.xml to sample.ci

* Regenerate 'kotlin-threetenbp' example

* Add build to gitignore

* Change default value for Kotlin

* Regenerate kotlin-string client

* Regenerate kotlin-threetenbp client

* Regenerate 'samples/client/petstore/kotlin'
This commit is contained in:
Jérémie Bresson 2018-05-09 04:32:37 +02:00 committed by William Cheng
parent e2d6f7c88f
commit d35bf1a388
254 changed files with 460 additions and 481 deletions

2
.gitignore vendored
View File

@ -174,6 +174,8 @@ samples/server/petstore/aspnetcore/.vs/
effective.pom effective.pom
# kotlin # kotlin
samples/client/petstore/kotlin/src/main/kotlin/test/ samples/client/petstore/kotlin/src/main/kotlin/test/
samples/client/petstore/kotlin-threetenbp/build
samples/client/petstore/kotlin-string/build
\? \?
# haskell # haskell

View File

@ -30,3 +30,5 @@ export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/
ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l kotlin --artifact-id kotlin-petstore-threetenbp -D dateLibrary=threetenbp -o samples/client/petstore/kotlin-threetenbp $@" ags="generate -t modules/openapi-generator/src/main/resources/kotlin-client -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -l kotlin --artifact-id kotlin-petstore-threetenbp -D dateLibrary=threetenbp -o samples/client/petstore/kotlin-threetenbp $@"
java ${JAVA_OPTS} -jar ${executable} ${ags} java ${JAVA_OPTS} -jar ${executable} ${ags}
cp samples.ci/client/petstore/kotlin-threetenbp/pom.xml samples/client/petstore/kotlin-threetenbp/pom.xml

View File

@ -55,7 +55,7 @@ public class KotlinClientCodegen extends AbstractKotlinCodegen {
super(); super();
artifactId = "kotlin-client"; artifactId = "kotlin-client";
packageName = "io.swagger.client"; packageName = "org.openapitools.client";
outputFolder = "generated-code" + File.separator + "kotlin-client"; outputFolder = "generated-code" + File.separator + "kotlin-client";
modelTemplateFiles.put("model.mustache", ".kt"); modelTemplateFiles.put("model.mustache", ".kt");

View File

@ -0,0 +1,46 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.openapitools</groupId>
<artifactId>KotlinPetstoreThreetenbpTests</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<name>kotlin-threetenbp</name>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>bundle-test</id>
<phase>integration-test</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>gradle</executable>
<arguments>
<argument>test</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,4 +1,4 @@
# io.swagger.client - Kotlin client library for OpenAPI Petstore # org.openapitools.client - Kotlin client library for OpenAPI Petstore
## Requires ## Requires
@ -60,12 +60,12 @@ Class | Method | HTTP request | Description
<a name="documentation-for-models"></a> <a name="documentation-for-models"></a>
## Documentation for Models ## Documentation for Models
- [io.swagger.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md)
- [io.swagger.client.models.Category](docs/Category.md) - [org.openapitools.client.models.Category](docs/Category.md)
- [io.swagger.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Order](docs/Order.md)
- [io.swagger.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Pet](docs/Pet.md)
- [io.swagger.client.models.Tag](docs/Tag.md) - [org.openapitools.client.models.Tag](docs/Tag.md)
- [io.swagger.client.models.User](docs/User.md) - [org.openapitools.client.models.User](docs/User.md)
<a name="documentation-for-authorization"></a> <a name="documentation-for-authorization"></a>

View File

@ -23,8 +23,8 @@ Add a new pet to the store
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val pet : Pet = // Pet | Pet object that needs to be added to the store val pet : Pet = // Pet | Pet object that needs to be added to the store
@ -67,8 +67,8 @@ Deletes a pet
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete
@ -115,8 +115,8 @@ Multiple status values can be provided with comma separated strings
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter
@ -162,8 +162,8 @@ Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by
@ -209,8 +209,8 @@ Returns a single pet
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return
@ -254,8 +254,8 @@ Update an existing pet
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val pet : Pet = // Pet | Pet object that needs to be added to the store val pet : Pet = // Pet | Pet object that needs to be added to the store
@ -298,8 +298,8 @@ Updates a pet in the store with form data
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated
@ -346,8 +346,8 @@ uploads an image
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = PetApi() val apiInstance = PetApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update

View File

@ -21,8 +21,8 @@ For valid response try integer IDs with value &lt; 1000. Anything above 1000 or
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = StoreApi() val apiInstance = StoreApi()
val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted
@ -67,8 +67,8 @@ Returns a map of status codes to quantities
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = StoreApi() val apiInstance = StoreApi()
try { try {
@ -110,8 +110,8 @@ For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other val
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = StoreApi() val apiInstance = StoreApi()
val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched
@ -155,8 +155,8 @@ Place an order for a pet
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = StoreApi() val apiInstance = StoreApi()
val order : Order = // Order | order placed for purchasing the pet val order : Order = // Order | order placed for purchasing the pet

View File

@ -25,8 +25,8 @@ This can only be done by the logged in user.
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val user : User = // User | Created user object val user : User = // User | Created user object
@ -69,8 +69,8 @@ Creates list of users with given input array
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
@ -113,8 +113,8 @@ Creates list of users with given input array
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
@ -159,8 +159,8 @@ This can only be done by the logged in user.
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted
@ -203,8 +203,8 @@ Get user by user name
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing. val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing.
@ -248,8 +248,8 @@ Logs user into the system
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | The user name for login val username : kotlin.String = username_example // kotlin.String | The user name for login
@ -295,8 +295,8 @@ Logs out current logged in user session
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
try { try {
@ -337,8 +337,8 @@ This can only be done by the logged in user.
### Example ### Example
```kotlin ```kotlin
// Import classes: // Import classes:
//import io.swagger.client.infrastructure.* //import org.openapitools.client.infrastructure.*
//import io.swagger.client.models.* //import org.openapitools.client.models.*
val apiInstance = UserApi() val apiInstance = UserApi()
val username : kotlin.String = username_example // kotlin.String | name that need to be deleted val username : kotlin.String = username_example // kotlin.String | name that need to be deleted

View File

@ -9,12 +9,12 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.apis package org.openapitools.client.apis
import io.swagger.client.models.ApiResponse import org.openapitools.client.models.ApiResponse
import io.swagger.client.models.Pet import org.openapitools.client.models.Pet
import io.swagger.client.infrastructure.* import org.openapitools.client.infrastructure.*
class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) {

View File

@ -9,11 +9,11 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.apis package org.openapitools.client.apis
import io.swagger.client.models.Order import org.openapitools.client.models.Order
import io.swagger.client.infrastructure.* import org.openapitools.client.infrastructure.*
class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) {

View File

@ -9,11 +9,11 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.apis package org.openapitools.client.apis
import io.swagger.client.models.User import org.openapitools.client.models.User
import io.swagger.client.infrastructure.* import org.openapitools.client.infrastructure.*
class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) { class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiClient(basePath) {

View File

@ -1,4 +1,4 @@
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
typealias MultiValueMap = Map<String,List<String>> typealias MultiValueMap = Map<String,List<String>>

View File

@ -1,4 +1,4 @@
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
import okhttp3.* import okhttp3.*
import java.io.File import java.io.File

View File

@ -1,4 +1,4 @@
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
enum class ResponseType { enum class ResponseType {
Success, Informational, Redirection, ClientError, ServerError Success, Informational, Redirection, ClientError, ServerError

View File

@ -1,4 +1,4 @@
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
import kotlin.properties.ReadWriteProperty import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty import kotlin.reflect.KProperty

View File

@ -1,5 +1,5 @@
@file:Suppress("unused") @file:Suppress("unused")
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
import java.lang.RuntimeException import java.lang.RuntimeException

View File

@ -1,4 +1,4 @@
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
/** /**
* Defines a config object for a given request. * Defines a config object for a given request.

View File

@ -1,4 +1,4 @@
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
/** /**
* Provides enumerated HTTP verbs * Provides enumerated HTTP verbs

View File

@ -1,4 +1,4 @@
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
import okhttp3.Response import okhttp3.Response

View File

@ -1,4 +1,4 @@
package io.swagger.client.infrastructure package org.openapitools.client.infrastructure
import com.squareup.moshi.KotlinJsonAdapterFactory import com.squareup.moshi.KotlinJsonAdapterFactory
import com.squareup.moshi.Moshi import com.squareup.moshi.Moshi

View File

@ -9,7 +9,7 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.models package org.openapitools.client.models
/** /**

View File

@ -9,7 +9,7 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.models package org.openapitools.client.models
/** /**

View File

@ -9,7 +9,7 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.models package org.openapitools.client.models
import com.squareup.moshi.Json import com.squareup.moshi.Json

View File

@ -9,10 +9,10 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.models package org.openapitools.client.models
import io.swagger.client.models.Category import org.openapitools.client.models.Category
import io.swagger.client.models.Tag import org.openapitools.client.models.Tag
import com.squareup.moshi.Json import com.squareup.moshi.Json
/** /**

View File

@ -9,7 +9,7 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.models package org.openapitools.client.models
/** /**

View File

@ -9,7 +9,7 @@
* https://openapi-generator.tech * https://openapi-generator.tech
* Do not edit the class manually. * Do not edit the class manually.
*/ */
package io.swagger.client.models package org.openapitools.client.models
/** /**

View File

@ -1,11 +1,11 @@
# Swagger Codegen Ignore # OpenAPI Generator Ignore
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen # Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator. # Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore. # The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs. # As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs #ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*): # You can match any string of characters against a directory, file or extension with a single asterisk (*):

View File

@ -1 +1 @@
2.4.0-SNAPSHOT 3.0.0-SNAPSHOT

View File

@ -1,4 +1,4 @@
# io.swagger.client - Kotlin client library for Swagger Petstore # org.openapitools.client - Kotlin client library for OpenAPI Petstore
## Requires ## Requires
@ -25,7 +25,7 @@ This runs all tests and packages the library.
* Supports JSON inputs/outputs, File inputs, and Form inputs. * Supports JSON inputs/outputs, File inputs, and Form inputs.
* Supports collection formats for query parameters: csv, tsv, ssv, pipes. * Supports collection formats for query parameters: csv, tsv, ssv, pipes.
* Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in Swagger definitions. * Some Kotlin and Java types are fully qualified to avoid conflicts with types defined in OpenAPI definitions.
* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets. * Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
<a name="documentation-for-api-endpoints"></a> <a name="documentation-for-api-endpoints"></a>
@ -60,12 +60,12 @@ Class | Method | HTTP request | Description
<a name="documentation-for-models"></a> <a name="documentation-for-models"></a>
## Documentation for Models ## Documentation for Models
- [io.swagger.client.models.ApiResponse](docs/ApiResponse.md) - [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md)
- [io.swagger.client.models.Category](docs/Category.md) - [org.openapitools.client.models.Category](docs/Category.md)
- [io.swagger.client.models.Order](docs/Order.md) - [org.openapitools.client.models.Order](docs/Order.md)
- [io.swagger.client.models.Pet](docs/Pet.md) - [org.openapitools.client.models.Pet](docs/Pet.md)
- [io.swagger.client.models.Tag](docs/Tag.md) - [org.openapitools.client.models.Tag](docs/Tag.md)
- [io.swagger.client.models.User](docs/User.md) - [org.openapitools.client.models.User](docs/User.md)
<a name="documentation-for-authorization"></a> <a name="documentation-for-authorization"></a>

View File

@ -1,4 +1,4 @@
group 'io.swagger' group 'org.openapitools'
version '1.0.0' version '1.0.0'
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {

Some files were not shown because too many files have changed in this diff Show More