Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/configs/kotlin-jvm-ktor-gson.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
generatorName: kotlin
outputDir: samples/client/petstore/kotlin-jvm-ktor-gson
library: jvm-ktor
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/kotlin/petstore.yaml
templateDir: modules/openapi-generator/src/main/resources/kotlin-client
additionalProperties:
artifactId: kotlin-petstore-jvm-ktor-gson
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ import com.fasterxml.jackson.databind.ObjectMapper
{{^isArray}}
{{^isString}}
{{^isNumber}}
{{{paramName}}}?.apply { append("{{{baseName}}}", {{{paramName}}}?.toString()) }
{{{paramName}}}?.apply { append("{{{baseName}}}", {{{paramName}}}.toString()) }
{{/isNumber}}
{{#isNumber}}
{{{paramName}}}?.apply { append("{{{baseName}}}", {{{paramName}}}?.toString()) }
{{{paramName}}}?.apply { append("{{{baseName}}}", {{{paramName}}}.toString()) }
{{/isNumber}}
{{/isString}}
{{#isString}}
Expand All @@ -98,10 +98,10 @@ import com.fasterxml.jackson.databind.ObjectMapper
{{^isArray}}
{{^isString}}
{{^isNumber}}
{{{paramName}}}?.apply { it.append("{{{baseName}}}", {{{paramName}}}?.toString()) }
{{{paramName}}}?.apply { it.append("{{{baseName}}}", {{{paramName}}}.toString()) }
{{/isNumber}}
{{#isNumber}}
{{{paramName}}}?.apply { it.append("{{{baseName}}}", {{{paramName}}}?.toString()) }
{{{paramName}}}?.apply { it.append("{{{baseName}}}", {{{paramName}}}.toString()) }
{{/isNumber}}
{{/isString}}
{{#isString}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,42 @@ paths:
responses:
'200':
description: OK
put:
tags:
- fake
summary: Updates a pet in the store with form data (number)
description: ''
operationId: updatePetWithFormNumber
parameters:
- name: petId
in: path
description: ID of pet that needs to be updated
required: true
schema:
type: integer
format: int64
responses:
'405':
description: Invalid input
security:
- petstore_auth:
- 'write:pets'
- 'read:pets'
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
name:
description: Updated name of the pet
type: string
status:
description: integer type
type: integer
status2:
description: number type
type: number
externalDocs:
description: Find out more about Swagger
url: 'http://swagger.io'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
README.md
build.gradle
docs/Annotation.md
docs/AnyOfUserOrPet.md
docs/AnyOfUserOrPetOrArrayString.md
docs/ApiResponse.md
docs/Category.md
docs/FakeApi.md
docs/Order.md
docs/Pet.md
docs/PetApi.md
docs/StoreApi.md
docs/Tag.md
docs/User.md
docs/UserApi.md
docs/UserOrPet.md
docs/UserOrPetOrArrayString.md
gradle/wrapper/gradle-wrapper.jar
gradle/wrapper/gradle-wrapper.properties
gradlew
gradlew.bat
settings.gradle
src/main/kotlin/org/openapitools/client/apis/FakeApi.kt
src/main/kotlin/org/openapitools/client/apis/PetApi.kt
src/main/kotlin/org/openapitools/client/apis/StoreApi.kt
src/main/kotlin/org/openapitools/client/apis/UserApi.kt
Expand All @@ -27,9 +34,14 @@ src/main/kotlin/org/openapitools/client/infrastructure/ApiClient.kt
src/main/kotlin/org/openapitools/client/infrastructure/HttpResponse.kt
src/main/kotlin/org/openapitools/client/infrastructure/RequestConfig.kt
src/main/kotlin/org/openapitools/client/infrastructure/RequestMethod.kt
src/main/kotlin/org/openapitools/client/models/Annotation.kt
src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPet.kt
src/main/kotlin/org/openapitools/client/models/AnyOfUserOrPetOrArrayString.kt
src/main/kotlin/org/openapitools/client/models/Category.kt
src/main/kotlin/org/openapitools/client/models/ModelApiResponse.kt
src/main/kotlin/org/openapitools/client/models/Order.kt
src/main/kotlin/org/openapitools/client/models/Pet.kt
src/main/kotlin/org/openapitools/client/models/Tag.kt
src/main/kotlin/org/openapitools/client/models/User.kt
src/main/kotlin/org/openapitools/client/models/UserOrPet.kt
src/main/kotlin/org/openapitools/client/models/UserOrPetOrArrayString.kt
7 changes: 7 additions & 0 deletions samples/client/petstore/kotlin-jvm-ktor-gson/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ All URIs are relative to *http://petstore.swagger.io/v2*

| Class | Method | HTTP request | Description |
| ------------ | ------------- | ------------- | ------------- |
| *FakeApi* | [**annotations**](docs/FakeApi.md#annotations) | **POST** /fake/annotations | annotate |
| *FakeApi* | [**updatePetWithFormNumber**](docs/FakeApi.md#updatepetwithformnumber) | **PUT** /fake/annotations | Updates a pet in the store with form data (number) |
| *PetApi* | [**addPet**](docs/PetApi.md#addpet) | **POST** /pet | Add a new pet to the store |
| *PetApi* | [**deletePet**](docs/PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet |
| *PetApi* | [**findPetsByStatus**](docs/PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status |
Expand All @@ -70,12 +72,17 @@ All URIs are relative to *http://petstore.swagger.io/v2*
<a id="documentation-for-models"></a>
## Documentation for Models

- [org.openapitools.client.models.Annotation](docs/Annotation.md)
- [org.openapitools.client.models.AnyOfUserOrPet](docs/AnyOfUserOrPet.md)
- [org.openapitools.client.models.AnyOfUserOrPetOrArrayString](docs/AnyOfUserOrPetOrArrayString.md)
- [org.openapitools.client.models.Category](docs/Category.md)
- [org.openapitools.client.models.ModelApiResponse](docs/ModelApiResponse.md)
- [org.openapitools.client.models.Order](docs/Order.md)
- [org.openapitools.client.models.Pet](docs/Pet.md)
- [org.openapitools.client.models.Tag](docs/Tag.md)
- [org.openapitools.client.models.User](docs/User.md)
- [org.openapitools.client.models.UserOrPet](docs/UserOrPet.md)
- [org.openapitools.client.models.UserOrPetOrArrayString](docs/UserOrPetOrArrayString.md)


<a id="documentation-for-authorization"></a>
Expand Down
10 changes: 10 additions & 0 deletions samples/client/petstore/kotlin-jvm-ktor-gson/docs/Annotation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

# Annotation

## Properties
| Name | Type | Description | Notes |
| ------------ | ------------- | ------------- | ------------- |
| **id** | [**java.util.UUID**](java.util.UUID.md) | | [optional] |



Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# AnyOfUserOrPet

## Properties
| Name | Type | Description | Notes |
| ------------ | ------------- | ------------- | ------------- |
| **username** | **kotlin.String** | | |
| **name** | **kotlin.String** | | |
| **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | | |
| **id** | **kotlin.Long** | | [optional] |
| **firstName** | **kotlin.String** | | [optional] |
| **lastName** | **kotlin.String** | | [optional] |
| **email** | **kotlin.String** | | [optional] |
| **password** | **kotlin.String** | | [optional] |
| **phone** | **kotlin.String** | | [optional] |
| **userStatus** | **kotlin.Int** | User Status | [optional] |
| **category** | [**Category**](Category.md) | | [optional] |
| **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional] |
| **status** | [**inline**](#Status) | pet status in the store | [optional] |


<a id="Status"></a>
## Enum: status
| Name | Value |
| ---- | ----- |
| status | available, pending, sold |



Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

# AnyOfUserOrPetOrArrayString

## Properties
| Name | Type | Description | Notes |
| ------------ | ------------- | ------------- | ------------- |
| **username** | **kotlin.String** | | |
| **name** | **kotlin.String** | | |
| **photoUrls** | **kotlin.collections.List&lt;kotlin.String&gt;** | | |
| **id** | **kotlin.Long** | | [optional] |
| **firstName** | **kotlin.String** | | [optional] |
| **lastName** | **kotlin.String** | | [optional] |
| **email** | **kotlin.String** | | [optional] |
| **password** | **kotlin.String** | | [optional] |
| **phone** | **kotlin.String** | | [optional] |
| **userStatus** | **kotlin.Int** | User Status | [optional] |
| **category** | [**Category**](Category.md) | | [optional] |
| **tags** | [**kotlin.collections.List&lt;Tag&gt;**](Tag.md) | | [optional] |
| **status** | [**inline**](#Status) | pet status in the store | [optional] |


<a id="Status"></a>
## Enum: status
| Name | Value |
| ---- | ----- |
| status | available, pending, sold |



106 changes: 106 additions & 0 deletions samples/client/petstore/kotlin-jvm-ktor-gson/docs/FakeApi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# FakeApi

All URIs are relative to *http://petstore.swagger.io/v2*

| Method | HTTP request | Description |
| ------------- | ------------- | ------------- |
| [**annotations**](FakeApi.md#annotations) | **POST** /fake/annotations | annotate |
| [**updatePetWithFormNumber**](FakeApi.md#updatePetWithFormNumber) | **PUT** /fake/annotations | Updates a pet in the store with form data (number) |


<a id="annotations"></a>
# **annotations**
> annotations(`annotation`)

annotate

### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*

val apiInstance = FakeApi()
val `annotation` : Annotation = // Annotation |
try {
apiInstance.annotations(`annotation`)
} catch (e: ClientException) {
println("4xx response calling FakeApi#annotations")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#annotations")
e.printStackTrace()
}
```

### Parameters
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **&#x60;annotation&#x60;** | [**Annotation**](Annotation.md)| | |

### Return type

null (empty response body)

### Authorization

No authorization required

### HTTP request headers

- **Content-Type**: application/json
- **Accept**: Not defined

<a id="updatePetWithFormNumber"></a>
# **updatePetWithFormNumber**
> updatePetWithFormNumber(petId, name, status, status2)

Updates a pet in the store with form data (number)



### Example
```kotlin
// Import classes:
//import org.openapitools.client.infrastructure.*
//import org.openapitools.client.models.*

val apiInstance = FakeApi()
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be updated
val name : kotlin.String = name_example // kotlin.String | Updated name of the pet
val status : kotlin.Int = 56 // kotlin.Int | integer type
val status2 : java.math.BigDecimal = 8.14 // java.math.BigDecimal | number type
try {
apiInstance.updatePetWithFormNumber(petId, name, status, status2)
} catch (e: ClientException) {
println("4xx response calling FakeApi#updatePetWithFormNumber")
e.printStackTrace()
} catch (e: ServerException) {
println("5xx response calling FakeApi#updatePetWithFormNumber")
e.printStackTrace()
}
```

### Parameters
| **petId** | **kotlin.Long**| ID of pet that needs to be updated | |
| **name** | **kotlin.String**| Updated name of the pet | [optional] |
| **status** | **kotlin.Int**| integer type | [optional] |
| Name | Type | Description | Notes |
| ------------- | ------------- | ------------- | ------------- |
| **status2** | **java.math.BigDecimal**| number type | [optional] |

### Return type

null (empty response body)

### Authorization


Configure petstore_auth:
ApiClient.accessToken = ""

### HTTP request headers

- **Content-Type**: application/x-www-form-urlencoded
- **Accept**: Not defined

Loading
Loading