diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java index 5169a3849f16..2d09ffa60565 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -1664,12 +1664,6 @@ public class DefaultCodegen implements CodegenConfig { // legacy support Map allowableValues = new HashMap(); - if (p.getMinimum() != null) { - allowableValues.put("min", p.getMinimum()); - } - if (p.getMaximum() != null) { - allowableValues.put("max", p.getMaximum()); - } if (p.getEnum() != null) { List _enum = p.getEnum(); diff --git a/samples/client/petstore/kotlin/.openapi-generator/VERSION b/samples/client/petstore/kotlin/.openapi-generator/VERSION index 855ff9501eb8..096bf47efe31 100644 --- a/samples/client/petstore/kotlin/.openapi-generator/VERSION +++ b/samples/client/petstore/kotlin/.openapi-generator/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +3.0.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin/build.gradle b/samples/client/petstore/kotlin/build.gradle index 58319e1a7ad3..8668dab3a7e6 100644 --- a/samples/client/petstore/kotlin/build.gradle +++ b/samples/client/petstore/kotlin/build.gradle @@ -1,4 +1,4 @@ -group 'io.swagger' +group 'org.openapitools' version '1.0.0' task wrapper(type: Wrapper) { diff --git a/samples/client/petstore/kotlin/docs/PetApi.md b/samples/client/petstore/kotlin/docs/PetApi.md index 29fb5bd0eeb8..c863a015f507 100644 --- a/samples/client/petstore/kotlin/docs/PetApi.md +++ b/samples/client/petstore/kotlin/docs/PetApi.md @@ -16,12 +16,10 @@ Method | HTTP request | Description # **addPet** -> addPet(body) +> addPet(pet) Add a new pet to the store - - ### Example ```kotlin // Import classes: @@ -29,9 +27,9 @@ Add a new pet to the store //import io.swagger.client.models.* val apiInstance = PetApi() -val body : 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 try { - apiInstance.addPet(body) + apiInstance.addPet(pet) } catch (e: ClientException) { println("4xx response calling PetApi#addPet") e.printStackTrace() @@ -45,7 +43,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -58,7 +56,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deletePet** @@ -66,8 +64,6 @@ null (empty response body) Deletes a pet - - ### Example ```kotlin // Import classes: @@ -106,7 +102,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **findPetsByStatus** @@ -251,12 +247,10 @@ Name | Type | Description | Notes # **updatePet** -> updatePet(body) +> updatePet(pet) Update an existing pet - - ### Example ```kotlin // Import classes: @@ -264,9 +258,9 @@ Update an existing pet //import io.swagger.client.models.* val apiInstance = PetApi() -val body : 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 try { - apiInstance.updatePet(body) + apiInstance.updatePet(pet) } catch (e: ClientException) { println("4xx response calling PetApi#updatePet") e.printStackTrace() @@ -280,7 +274,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | + **pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | ### Return type @@ -293,7 +287,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updatePetWithForm** @@ -301,8 +295,6 @@ null (empty response body) Updates a pet in the store with form data - - ### Example ```kotlin // Import classes: @@ -343,7 +335,7 @@ null (empty response body) ### HTTP request headers - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **uploadFile** @@ -351,8 +343,6 @@ null (empty response body) uploads an image - - ### Example ```kotlin // Import classes: @@ -362,7 +352,7 @@ uploads an image val apiInstance = PetApi() val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server -val file : java.io.File = /path/to/file.txt // java.io.File | file to upload +val file : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload try { val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file) println(result) diff --git a/samples/client/petstore/kotlin/docs/StoreApi.md b/samples/client/petstore/kotlin/docs/StoreApi.md index 022e1362b0f8..b8647a0757d9 100644 --- a/samples/client/petstore/kotlin/docs/StoreApi.md +++ b/samples/client/petstore/kotlin/docs/StoreApi.md @@ -54,7 +54,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getInventory** @@ -148,12 +148,10 @@ No authorization required # **placeOrder** -> Order placeOrder(body) +> Order placeOrder(order) Place an order for a pet - - ### Example ```kotlin // Import classes: @@ -161,9 +159,9 @@ Place an order for a pet //import io.swagger.client.models.* val apiInstance = StoreApi() -val body : Order = // Order | order placed for purchasing the pet +val order : Order = // Order | order placed for purchasing the pet try { - val result : Order = apiInstance.placeOrder(body) + val result : Order = apiInstance.placeOrder(order) println(result) } catch (e: ClientException) { println("4xx response calling StoreApi#placeOrder") @@ -178,7 +176,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | + **order** | [**Order**](Order.md)| order placed for purchasing the pet | ### Return type diff --git a/samples/client/petstore/kotlin/docs/UserApi.md b/samples/client/petstore/kotlin/docs/UserApi.md index 0c4b9b79de84..1dd05e8f988d 100644 --- a/samples/client/petstore/kotlin/docs/UserApi.md +++ b/samples/client/petstore/kotlin/docs/UserApi.md @@ -16,7 +16,7 @@ Method | HTTP request | Description # **createUser** -> createUser(body) +> createUser(user) Create user @@ -29,9 +29,9 @@ This can only be done by the logged in user. //import io.swagger.client.models.* val apiInstance = UserApi() -val body : User = // User | Created user object +val user : User = // User | Created user object try { - apiInstance.createUser(body) + apiInstance.createUser(user) } catch (e: ClientException) { println("4xx response calling UserApi#createUser") e.printStackTrace() @@ -45,7 +45,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | + **user** | [**User**](User.md)| Created user object | ### Return type @@ -58,16 +58,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithArrayInput** -> createUsersWithArrayInput(body) +> createUsersWithArrayInput(user) Creates list of users with given input array - - ### Example ```kotlin // Import classes: @@ -75,9 +73,9 @@ Creates list of users with given input array //import io.swagger.client.models.* val apiInstance = UserApi() -val body : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.Array = // kotlin.Array | List of user object try { - apiInstance.createUsersWithArrayInput(body) + apiInstance.createUsersWithArrayInput(user) } catch (e: ClientException) { println("4xx response calling UserApi#createUsersWithArrayInput") e.printStackTrace() @@ -91,7 +89,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object | ### Return type @@ -104,16 +102,14 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **createUsersWithListInput** -> createUsersWithListInput(body) +> createUsersWithListInput(user) Creates list of users with given input array - - ### Example ```kotlin // Import classes: @@ -121,9 +117,9 @@ Creates list of users with given input array //import io.swagger.client.models.* val apiInstance = UserApi() -val body : kotlin.Array = // kotlin.Array | List of user object +val user : kotlin.Array = // kotlin.Array | List of user object try { - apiInstance.createUsersWithListInput(body) + apiInstance.createUsersWithListInput(user) } catch (e: ClientException) { println("4xx response calling UserApi#createUsersWithListInput") e.printStackTrace() @@ -137,7 +133,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**kotlin.Array<User>**](User.md)| List of user object | + **user** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object | ### Return type @@ -150,7 +146,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **deleteUser** @@ -196,7 +192,7 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **getUserByName** @@ -204,8 +200,6 @@ No authorization required Get user by user name - - ### Example ```kotlin // Import classes: @@ -251,8 +245,6 @@ No authorization required Logs user into the system - - ### Example ```kotlin // Import classes: @@ -300,8 +292,6 @@ No authorization required Logs out current logged in user session - - ### Example ```kotlin // Import classes: @@ -334,11 +324,11 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined # **updateUser** -> updateUser(username, body) +> updateUser(username, user) Updated user @@ -352,9 +342,9 @@ This can only be done by the logged in user. val apiInstance = UserApi() val username : kotlin.String = username_example // kotlin.String | name that need to be deleted -val body : User = // User | Updated user object +val user : User = // User | Updated user object try { - apiInstance.updateUser(username, body) + apiInstance.updateUser(username, user) } catch (e: ClientException) { println("4xx response calling UserApi#updateUser") e.printStackTrace() @@ -369,7 +359,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **username** | **kotlin.String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | + **user** | [**User**](User.md)| Updated user object | ### Return type @@ -382,5 +372,5 @@ No authorization required ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/xml, application/json + - **Accept**: Not defined diff --git a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt index 5d6d2f187ebc..397502f64ce5 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/PetApi.kt @@ -21,11 +21,11 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli /** * Add a new pet to the store * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - fun addPet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body + fun addPet(pet: Pet) : Unit { + val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mapOf() val localVariableHeaders: kotlin.collections.Map = mapOf() val localVariableConfig = RequestConfig( @@ -180,11 +180,11 @@ class PetApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCli /** * Update an existing pet * - * @param body Pet object that needs to be added to the store + * @param pet Pet object that needs to be added to the store * @return void */ - fun updatePet(body: Pet) : Unit { - val localVariableBody: kotlin.Any? = body + fun updatePet(pet: Pet) : Unit { + val localVariableBody: kotlin.Any? = pet val localVariableQuery: MultiValueMap = mapOf() val localVariableHeaders: kotlin.collections.Map = mapOf() val localVariableConfig = RequestConfig( diff --git a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/StoreApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/StoreApi.kt index 53e3813f4dc2..7592d33dbbc4 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/StoreApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/StoreApi.kt @@ -114,12 +114,12 @@ class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiC /** * Place an order for a pet * - * @param body order placed for purchasing the pet + * @param order order placed for purchasing the pet * @return Order */ @Suppress("UNCHECKED_CAST") - fun placeOrder(body: Order) : Order { - val localVariableBody: kotlin.Any? = body + fun placeOrder(order: Order) : Order { + val localVariableBody: kotlin.Any? = order val localVariableQuery: MultiValueMap = mapOf() val localVariableHeaders: kotlin.collections.Map = mapOf() val localVariableConfig = RequestConfig( diff --git a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/UserApi.kt b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/UserApi.kt index 9bd50f0f4c0f..7f774eaa3938 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/UserApi.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/apis/UserApi.kt @@ -20,11 +20,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl /** * Create user * This can only be done by the logged in user. - * @param body Created user object + * @param user Created user object * @return void */ - fun createUser(body: User) : Unit { - val localVariableBody: kotlin.Any? = body + fun createUser(user: User) : Unit { + val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() val localVariableHeaders: kotlin.collections.Map = mapOf() val localVariableConfig = RequestConfig( @@ -51,11 +51,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @return void */ - fun createUsersWithArrayInput(body: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = body + fun createUsersWithArrayInput(user: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() val localVariableHeaders: kotlin.collections.Map = mapOf() val localVariableConfig = RequestConfig( @@ -82,11 +82,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl /** * Creates list of users with given input array * - * @param body List of user object + * @param user List of user object * @return void */ - fun createUsersWithListInput(body: kotlin.Array) : Unit { - val localVariableBody: kotlin.Any? = body + fun createUsersWithListInput(user: kotlin.Array) : Unit { + val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() val localVariableHeaders: kotlin.collections.Map = mapOf() val localVariableConfig = RequestConfig( @@ -240,11 +240,11 @@ class UserApi(basePath: kotlin.String = "http://petstore.swagger.io/v2") : ApiCl * Updated user * This can only be done by the logged in user. * @param username name that need to be deleted - * @param body Updated user object + * @param user Updated user object * @return void */ - fun updateUser(username: kotlin.String, body: User) : Unit { - val localVariableBody: kotlin.Any? = body + fun updateUser(username: kotlin.String, user: User) : Unit { + val localVariableBody: kotlin.Any? = user val localVariableQuery: MultiValueMap = mapOf() val localVariableHeaders: kotlin.collections.Map = mapOf() val localVariableConfig = RequestConfig(