forked from loafle/openapi-generator-original
Fix missing closing parenthesis (#1739)
* Add a script to generate kotlin client samples from OAS3 * Generate kotlin client * Fix missing closing parenthesis * Update samples * Add build folder to gitignore
This commit is contained in:
parent
2ccfdc8e5d
commit
05107032d1
1
.gitignore
vendored
1
.gitignore
vendored
@ -180,6 +180,7 @@ samples/client/petstore/kotlin/src/main/kotlin/test/
|
||||
samples/client/petstore/kotlin-threetenbp/build
|
||||
samples/client/petstore/kotlin-string/build
|
||||
samples/server/petstore/kotlin-server/ktor/build
|
||||
samples/openapi3/client/petstore/kotlin/build
|
||||
\?
|
||||
|
||||
# haskell
|
||||
|
35
bin/openapi3/kotlin-client-petstore.sh
Executable file
35
bin/openapi3/kotlin-client-petstore.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/sh
|
||||
|
||||
SCRIPT="$0"
|
||||
echo "# START SCRIPT: $SCRIPT"
|
||||
|
||||
while [ -h "$SCRIPT" ] ; do
|
||||
ls=$(ls -ld "$SCRIPT")
|
||||
link=$(expr "$ls" : '.*-> \(.*\)$')
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
SCRIPT="$link"
|
||||
else
|
||||
SCRIPT=$(dirname "$SCRIPT")/"$link"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ ! -d "${APP_DIR}" ]; then
|
||||
APP_DIR=$(dirname "$SCRIPT")/..
|
||||
APP_DIR=$(cd "${APP_DIR}"; pwd)
|
||||
fi
|
||||
|
||||
executable="./modules/openapi-generator-cli/target/openapi-generator-cli.jar"
|
||||
|
||||
if [ ! -f "$executable" ]
|
||||
then
|
||||
mvn clean package
|
||||
fi
|
||||
|
||||
export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties"
|
||||
ags="$@ generate -i modules/openapi-generator/src/test/resources/3_0/petstore-with-fake-endpoints-models-for-testing.yaml -t modules/openapi-generator/src/main/resources/kotlin-client -g kotlin --artifact-id kotlin-petstore-client -D dateLibrary=java8 -o samples/openapi3/client/petstore/kotlin $@"
|
||||
|
||||
echo "Cleaning previously generated files if any from samples/openapi3/client/petstore/kotlin"
|
||||
rm -rf samples/openapi3/client/petstore/kotlin
|
||||
|
||||
echo "Generating Kotling client..."
|
||||
java $JAVA_OPTS -jar $executable $ags
|
@ -23,7 +23,7 @@ class {{classname}}(basePath: kotlin.String = "{{{basePath}}}") : ApiClient(base
|
||||
fun {{operationId}}({{#allParams}}{{paramName}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}} {
|
||||
val localVariableBody: kotlin.Any? = {{#hasBodyParam}}{{#bodyParams}}{{paramName}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}null{{/hasFormParams}}{{#hasFormParams}}mapOf({{#formParams}}"{{{baseName}}}" to "${{paramName}}"{{#hasMore}}, {{/hasMore}}{{/formParams}}){{/hasFormParams}}{{/hasBodyParam}}
|
||||
val localVariableQuery: MultiValueMap = {{^hasQueryParams}}mapOf(){{/hasQueryParams}}{{#hasQueryParams}}mapOf({{#queryParams}}"{{baseName}}" to {{#isContainer}}toMultiValue({{paramName}}.toList(), "{{collectionFormat}}"){{/isContainer}}{{^isContainer}}listOf("${{paramName}}"){{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/queryParams}}){{/hasQueryParams}}
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}"){{/isContainer}}{{^isContainer}}{{paramName}}{{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}}
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf({{#hasFormParams}}"Content-Type" to "multipart/form-data"{{/hasFormParams}}{{^hasHeaderParams}}){{/hasHeaderParams}}{{#hasHeaderParams}}{{#hasFormParams}}, {{/hasFormParams}}{{#headerParams}}"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(separator = collectionDelimiter("{{collectionFormat}}")){{/isContainer}}{{^isContainer}}{{paramName}}{{/isContainer}}{{#hasMore}}, {{/hasMore}}{{/headerParams}}){{/hasHeaderParams}}
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.{{httpMethod}},
|
||||
"{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", "${{paramName}}"){{/pathParams}},
|
||||
|
@ -0,0 +1,23 @@
|
||||
# OpenAPI Generator Ignore
|
||||
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
||||
|
||||
# Use this file to prevent files from being overwritten by the generator.
|
||||
# The patterns follow closely to .gitignore or .dockerignore.
|
||||
|
||||
# As an example, the C# client generator defines ApiClient.cs.
|
||||
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
||||
#ApiClient.cs
|
||||
|
||||
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
||||
#foo/*/qux
|
||||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
||||
|
||||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
||||
#foo/**/qux
|
||||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
||||
|
||||
# You can also negate patterns with an exclamation (!).
|
||||
# For example, you can ignore all files in a docs folder with the file extension .md:
|
||||
#docs/*.md
|
||||
# Then explicitly reverse the ignore rule for a single file:
|
||||
#!docs/README.md
|
@ -0,0 +1 @@
|
||||
4.0.0-SNAPSHOT
|
153
samples/openapi3/client/petstore/kotlin/README.md
Normal file
153
samples/openapi3/client/petstore/kotlin/README.md
Normal file
@ -0,0 +1,153 @@
|
||||
# org.openapitools.client - Kotlin client library for OpenAPI Petstore
|
||||
|
||||
## Requires
|
||||
|
||||
* Kotlin 1.1.2
|
||||
* Gradle 3.3
|
||||
|
||||
## Build
|
||||
|
||||
First, create the gradle wrapper script:
|
||||
|
||||
```
|
||||
gradle wrapper
|
||||
```
|
||||
|
||||
Then, run:
|
||||
|
||||
```
|
||||
./gradlew check assemble
|
||||
```
|
||||
|
||||
This runs all tests and packages the library.
|
||||
|
||||
## Features/Implementation Notes
|
||||
|
||||
* Supports JSON inputs/outputs, File inputs, and Form inputs.
|
||||
* 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 OpenAPI definitions.
|
||||
* Implementation of ApiClient is intended to reduce method counts, specifically to benefit Android targets.
|
||||
|
||||
<a name="documentation-for-api-endpoints"></a>
|
||||
## Documentation for API Endpoints
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Class | Method | HTTP request | Description
|
||||
------------ | ------------- | ------------- | -------------
|
||||
*AnotherFakeApi* | [**call123testSpecialTags**](docs/AnotherFakeApi.md#call123testspecialtags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
*DefaultApi* | [**fooGet**](docs/DefaultApi.md#fooget) | **GET** /foo |
|
||||
*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeouterbooleanserialize) | **POST** /fake/outer/boolean |
|
||||
*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeoutercompositeserialize) | **POST** /fake/outer/composite |
|
||||
*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeouternumberserialize) | **POST** /fake/outer/number |
|
||||
*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeouterstringserialize) | **POST** /fake/outer/string |
|
||||
*FakeApi* | [**testBodyWithFileSchema**](docs/FakeApi.md#testbodywithfileschema) | **PUT** /fake/body-with-file-schema |
|
||||
*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testbodywithqueryparams) | **PUT** /fake/body-with-query-params |
|
||||
*FakeApi* | [**testClientModel**](docs/FakeApi.md#testclientmodel) | **PATCH** /fake | To test \"client\" model
|
||||
*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testendpointparameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testenumparameters) | **GET** /fake | To test enum parameters
|
||||
*FakeApi* | [**testGroupParameters**](docs/FakeApi.md#testgroupparameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testinlineadditionalproperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testjsonformdata) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testclassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
*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
|
||||
*PetApi* | [**findPetsByTags**](docs/PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
*PetApi* | [**getPetById**](docs/PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID
|
||||
*PetApi* | [**updatePet**](docs/PetApi.md#updatepet) | **PUT** /pet | Update an existing pet
|
||||
*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
*PetApi* | [**uploadFile**](docs/PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
*PetApi* | [**uploadFileWithRequiredFile**](docs/PetApi.md#uploadfilewithrequiredfile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteorder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
*StoreApi* | [**getInventory**](docs/StoreApi.md#getinventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
*StoreApi* | [**getOrderById**](docs/StoreApi.md#getorderbyid) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeorder) | **POST** /store/order | Place an order for a pet
|
||||
*UserApi* | [**createUser**](docs/UserApi.md#createuser) | **POST** /user | Create user
|
||||
*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createuserswitharrayinput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createuserswithlistinput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
*UserApi* | [**deleteUser**](docs/UserApi.md#deleteuser) | **DELETE** /user/{username} | Delete user
|
||||
*UserApi* | [**getUserByName**](docs/UserApi.md#getuserbyname) | **GET** /user/{username} | Get user by user name
|
||||
*UserApi* | [**loginUser**](docs/UserApi.md#loginuser) | **GET** /user/login | Logs user into the system
|
||||
*UserApi* | [**logoutUser**](docs/UserApi.md#logoutuser) | **GET** /user/logout | Logs out current logged in user session
|
||||
*UserApi* | [**updateUser**](docs/UserApi.md#updateuser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
<a name="documentation-for-models"></a>
|
||||
## Documentation for Models
|
||||
|
||||
- [org.openapitools.client.models.AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md)
|
||||
- [org.openapitools.client.models.Animal](docs/Animal.md)
|
||||
- [org.openapitools.client.models.ApiResponse](docs/ApiResponse.md)
|
||||
- [org.openapitools.client.models.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md)
|
||||
- [org.openapitools.client.models.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md)
|
||||
- [org.openapitools.client.models.ArrayTest](docs/ArrayTest.md)
|
||||
- [org.openapitools.client.models.Capitalization](docs/Capitalization.md)
|
||||
- [org.openapitools.client.models.Cat](docs/Cat.md)
|
||||
- [org.openapitools.client.models.Category](docs/Category.md)
|
||||
- [org.openapitools.client.models.ClassModel](docs/ClassModel.md)
|
||||
- [org.openapitools.client.models.Client](docs/Client.md)
|
||||
- [org.openapitools.client.models.Dog](docs/Dog.md)
|
||||
- [org.openapitools.client.models.EnumArrays](docs/EnumArrays.md)
|
||||
- [org.openapitools.client.models.EnumClass](docs/EnumClass.md)
|
||||
- [org.openapitools.client.models.EnumTest](docs/EnumTest.md)
|
||||
- [org.openapitools.client.models.FileSchemaTestClass](docs/FileSchemaTestClass.md)
|
||||
- [org.openapitools.client.models.Foo](docs/Foo.md)
|
||||
- [org.openapitools.client.models.FormatTest](docs/FormatTest.md)
|
||||
- [org.openapitools.client.models.HasOnlyReadOnly](docs/HasOnlyReadOnly.md)
|
||||
- [org.openapitools.client.models.InlineObject](docs/InlineObject.md)
|
||||
- [org.openapitools.client.models.InlineObject1](docs/InlineObject1.md)
|
||||
- [org.openapitools.client.models.InlineObject2](docs/InlineObject2.md)
|
||||
- [org.openapitools.client.models.InlineObject3](docs/InlineObject3.md)
|
||||
- [org.openapitools.client.models.InlineObject4](docs/InlineObject4.md)
|
||||
- [org.openapitools.client.models.InlineObject5](docs/InlineObject5.md)
|
||||
- [org.openapitools.client.models.InlineResponseDefault](docs/InlineResponseDefault.md)
|
||||
- [org.openapitools.client.models.List](docs/List.md)
|
||||
- [org.openapitools.client.models.MapTest](docs/MapTest.md)
|
||||
- [org.openapitools.client.models.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md)
|
||||
- [org.openapitools.client.models.Model200Response](docs/Model200Response.md)
|
||||
- [org.openapitools.client.models.Name](docs/Name.md)
|
||||
- [org.openapitools.client.models.NumberOnly](docs/NumberOnly.md)
|
||||
- [org.openapitools.client.models.Order](docs/Order.md)
|
||||
- [org.openapitools.client.models.OuterComposite](docs/OuterComposite.md)
|
||||
- [org.openapitools.client.models.OuterEnum](docs/OuterEnum.md)
|
||||
- [org.openapitools.client.models.Pet](docs/Pet.md)
|
||||
- [org.openapitools.client.models.ReadOnlyFirst](docs/ReadOnlyFirst.md)
|
||||
- [org.openapitools.client.models.Return](docs/Return.md)
|
||||
- [org.openapitools.client.models.SpecialModelname](docs/SpecialModelname.md)
|
||||
- [org.openapitools.client.models.Tag](docs/Tag.md)
|
||||
- [org.openapitools.client.models.User](docs/User.md)
|
||||
|
||||
|
||||
<a name="documentation-for-authorization"></a>
|
||||
## Documentation for Authorization
|
||||
|
||||
<a name="api_key"></a>
|
||||
### api_key
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key
|
||||
- **Location**: HTTP header
|
||||
|
||||
<a name="api_key_query"></a>
|
||||
### api_key_query
|
||||
|
||||
- **Type**: API key
|
||||
- **API key parameter name**: api_key_query
|
||||
- **Location**: URL query string
|
||||
|
||||
<a name="http_basic_test"></a>
|
||||
### http_basic_test
|
||||
|
||||
- **Type**: HTTP basic authentication
|
||||
|
||||
<a name="petstore_auth"></a>
|
||||
### petstore_auth
|
||||
|
||||
- **Type**: OAuth
|
||||
- **Flow**: implicit
|
||||
- **Authorization URL**: http://petstore.swagger.io/api/oauth/dialog
|
||||
- **Scopes**:
|
||||
- write:pets: modify pets in your account
|
||||
- read:pets: read your pets
|
||||
|
33
samples/openapi3/client/petstore/kotlin/build.gradle
Normal file
33
samples/openapi3/client/petstore/kotlin/build.gradle
Normal file
@ -0,0 +1,33 @@
|
||||
group 'org.openapitools'
|
||||
version '1.0.0'
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = '3.3'
|
||||
distributionUrl = "https://services.gradle.org/distributions/gradle-$gradleVersion-all.zip"
|
||||
}
|
||||
|
||||
buildscript {
|
||||
ext.kotlin_version = '1.1.2'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||
}
|
||||
}
|
||||
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib-jre8:$kotlin_version"
|
||||
compile "com.squareup.moshi:moshi-kotlin:1.5.0"
|
||||
compile "com.squareup.moshi:moshi-adapters:1.5.0"
|
||||
compile "com.squareup.okhttp3:okhttp:3.8.0"
|
||||
compile "org.threeten:threetenbp:1.3.6"
|
||||
testCompile "io.kotlintest:kotlintest:2.0.2"
|
||||
}
|
11
samples/openapi3/client/petstore/kotlin/docs/200_response.md
Normal file
11
samples/openapi3/client/petstore/kotlin/docs/200_response.md
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
# Model200Response
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **kotlin.Int** | | [optional]
|
||||
**propertyClass** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# AdditionalPropertiesClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.String>** | | [optional]
|
||||
**mapOfMapProperty** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional]
|
||||
|
||||
|
||||
|
11
samples/openapi3/client/petstore/kotlin/docs/Animal.md
Normal file
11
samples/openapi3/client/petstore/kotlin/docs/Animal.md
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
# Animal
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**className** | **kotlin.String** | |
|
||||
**color** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,56 @@
|
||||
# AnotherFakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**call123testSpecialTags**](AnotherFakeApi.md#call123testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags
|
||||
|
||||
|
||||
<a name="call123testSpecialTags"></a>
|
||||
# **call123testSpecialTags**
|
||||
> Client call123testSpecialTags(client)
|
||||
|
||||
To test special tags
|
||||
|
||||
To test special tags and operation ID starting with number
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = AnotherFakeApi()
|
||||
val client : Client = // Client | client model
|
||||
try {
|
||||
val result : Client = apiInstance.call123testSpecialTags(client)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling AnotherFakeApi#call123testSpecialTags")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling AnotherFakeApi#call123testSpecialTags")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
12
samples/openapi3/client/petstore/kotlin/docs/ApiResponse.md
Normal file
12
samples/openapi3/client/petstore/kotlin/docs/ApiResponse.md
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
# ApiResponse
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**code** | **kotlin.Int** | | [optional]
|
||||
**type** | **kotlin.String** | | [optional]
|
||||
**message** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
|
||||
# ArrayOfArrayOfNumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayArrayNumber** | **kotlin.Array<kotlin.Array<java.math.BigDecimal>>** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
|
||||
# ArrayOfNumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayNumber** | [**kotlin.Array<java.math.BigDecimal>**](java.math.BigDecimal.md) | | [optional]
|
||||
|
||||
|
||||
|
12
samples/openapi3/client/petstore/kotlin/docs/ArrayTest.md
Normal file
12
samples/openapi3/client/petstore/kotlin/docs/ArrayTest.md
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
# ArrayTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**arrayOfString** | **kotlin.Array<kotlin.String>** | | [optional]
|
||||
**arrayArrayOfInteger** | **kotlin.Array<kotlin.Array<kotlin.Long>>** | | [optional]
|
||||
**arrayArrayOfModel** | **kotlin.Array<kotlin.Array<ReadOnlyFirst>>** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,15 @@
|
||||
|
||||
# Capitalization
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**smallCamel** | **kotlin.String** | | [optional]
|
||||
**capitalCamel** | **kotlin.String** | | [optional]
|
||||
**smallSnake** | **kotlin.String** | | [optional]
|
||||
**capitalSnake** | **kotlin.String** | | [optional]
|
||||
**scAETHFlowPoints** | **kotlin.String** | | [optional]
|
||||
**ATT_NAME** | **kotlin.String** | Name of the pet | [optional]
|
||||
|
||||
|
||||
|
10
samples/openapi3/client/petstore/kotlin/docs/Cat.md
Normal file
10
samples/openapi3/client/petstore/kotlin/docs/Cat.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Cat
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**declawed** | **kotlin.Boolean** | | [optional]
|
||||
|
||||
|
||||
|
11
samples/openapi3/client/petstore/kotlin/docs/Category.md
Normal file
11
samples/openapi3/client/petstore/kotlin/docs/Category.md
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
# Category
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **kotlin.Long** | | [optional]
|
||||
**name** | **kotlin.String** | |
|
||||
|
||||
|
||||
|
10
samples/openapi3/client/petstore/kotlin/docs/ClassModel.md
Normal file
10
samples/openapi3/client/petstore/kotlin/docs/ClassModel.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# ClassModel
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**propertyClass** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
10
samples/openapi3/client/petstore/kotlin/docs/Client.md
Normal file
10
samples/openapi3/client/petstore/kotlin/docs/Client.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**client** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
50
samples/openapi3/client/petstore/kotlin/docs/DefaultApi.md
Normal file
50
samples/openapi3/client/petstore/kotlin/docs/DefaultApi.md
Normal file
@ -0,0 +1,50 @@
|
||||
# DefaultApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**fooGet**](DefaultApi.md#fooGet) | **GET** /foo |
|
||||
|
||||
|
||||
<a name="fooGet"></a>
|
||||
# **fooGet**
|
||||
> InlineResponseDefault fooGet()
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = DefaultApi()
|
||||
try {
|
||||
val result : InlineResponseDefault = apiInstance.fooGet()
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling DefaultApi#fooGet")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling DefaultApi#fooGet")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
[**InlineResponseDefault**](InlineResponseDefault.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
10
samples/openapi3/client/petstore/kotlin/docs/Dog.md
Normal file
10
samples/openapi3/client/petstore/kotlin/docs/Dog.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Dog
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**breed** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
25
samples/openapi3/client/petstore/kotlin/docs/EnumArrays.md
Normal file
25
samples/openapi3/client/petstore/kotlin/docs/EnumArrays.md
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
# EnumArrays
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justSymbol** | [**inline**](#JustSymbolEnum) | | [optional]
|
||||
**arrayEnum** | [**inline**](#kotlin.Array<ArrayEnumEnum>) | | [optional]
|
||||
|
||||
|
||||
<a name="JustSymbolEnum"></a>
|
||||
## Enum: just_symbol
|
||||
Name | Value
|
||||
---- | -----
|
||||
justSymbol | >=, $
|
||||
|
||||
|
||||
<a name="kotlin.Array<ArrayEnumEnum>"></a>
|
||||
## Enum: array_enum
|
||||
Name | Value
|
||||
---- | -----
|
||||
arrayEnum | fish, crab
|
||||
|
||||
|
||||
|
14
samples/openapi3/client/petstore/kotlin/docs/EnumClass.md
Normal file
14
samples/openapi3/client/petstore/kotlin/docs/EnumClass.md
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
# EnumClass
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `abc` (value: `"_abc"`)
|
||||
|
||||
* `minusefg` (value: `"-efg"`)
|
||||
|
||||
* `leftParenthesisxyzRightParenthesis` (value: `"(xyz)"`)
|
||||
|
||||
|
||||
|
42
samples/openapi3/client/petstore/kotlin/docs/Enum_Test.md
Normal file
42
samples/openapi3/client/petstore/kotlin/docs/Enum_Test.md
Normal file
@ -0,0 +1,42 @@
|
||||
|
||||
# EnumTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**enumString** | [**inline**](#EnumStringEnum) | | [optional]
|
||||
**enumStringRequired** | [**inline**](#EnumStringRequiredEnum) | |
|
||||
**enumInteger** | [**inline**](#EnumIntegerEnum) | | [optional]
|
||||
**enumNumber** | [**inline**](#EnumNumberEnum) | | [optional]
|
||||
**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional]
|
||||
|
||||
|
||||
<a name="EnumStringEnum"></a>
|
||||
## Enum: enum_string
|
||||
Name | Value
|
||||
---- | -----
|
||||
enumString | UPPER, lower,
|
||||
|
||||
|
||||
<a name="EnumStringRequiredEnum"></a>
|
||||
## Enum: enum_string_required
|
||||
Name | Value
|
||||
---- | -----
|
||||
enumStringRequired | UPPER, lower,
|
||||
|
||||
|
||||
<a name="EnumIntegerEnum"></a>
|
||||
## Enum: enum_integer
|
||||
Name | Value
|
||||
---- | -----
|
||||
enumInteger | 1, -1
|
||||
|
||||
|
||||
<a name="EnumNumberEnum"></a>
|
||||
## Enum: enum_number
|
||||
Name | Value
|
||||
---- | -----
|
||||
enumNumber | 1.1, -1.2
|
||||
|
||||
|
||||
|
625
samples/openapi3/client/petstore/kotlin/docs/FakeApi.md
Normal file
625
samples/openapi3/client/petstore/kotlin/docs/FakeApi.md
Normal file
@ -0,0 +1,625 @@
|
||||
# FakeApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**fakeOuterBooleanSerialize**](FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean |
|
||||
[**fakeOuterCompositeSerialize**](FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite |
|
||||
[**fakeOuterNumberSerialize**](FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number |
|
||||
[**fakeOuterStringSerialize**](FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string |
|
||||
[**testBodyWithFileSchema**](FakeApi.md#testBodyWithFileSchema) | **PUT** /fake/body-with-file-schema |
|
||||
[**testBodyWithQueryParams**](FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params |
|
||||
[**testClientModel**](FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model
|
||||
[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
[**testEnumParameters**](FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters
|
||||
[**testGroupParameters**](FakeApi.md#testGroupParameters) | **DELETE** /fake | Fake endpoint to test group parameters (optional)
|
||||
[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties
|
||||
[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data
|
||||
|
||||
|
||||
<a name="fakeOuterBooleanSerialize"></a>
|
||||
# **fakeOuterBooleanSerialize**
|
||||
> kotlin.Boolean fakeOuterBooleanSerialize(body)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer boolean types
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val body : kotlin.Boolean = true // kotlin.Boolean | Input boolean as post body
|
||||
try {
|
||||
val result : kotlin.Boolean = apiInstance.fakeOuterBooleanSerialize(body)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#fakeOuterBooleanSerialize")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#fakeOuterBooleanSerialize")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **kotlin.Boolean**| Input boolean as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**kotlin.Boolean**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterCompositeSerialize"></a>
|
||||
# **fakeOuterCompositeSerialize**
|
||||
> OuterComposite fakeOuterCompositeSerialize(outerComposite)
|
||||
|
||||
|
||||
|
||||
Test serialization of object with outer number type
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val outerComposite : OuterComposite = // OuterComposite | Input composite as post body
|
||||
try {
|
||||
val result : OuterComposite = apiInstance.fakeOuterCompositeSerialize(outerComposite)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#fakeOuterCompositeSerialize")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#fakeOuterCompositeSerialize")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**outerComposite** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**OuterComposite**](OuterComposite.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterNumberSerialize"></a>
|
||||
# **fakeOuterNumberSerialize**
|
||||
> java.math.BigDecimal fakeOuterNumberSerialize(body)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer number types
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val body : java.math.BigDecimal = 1.2 // java.math.BigDecimal | Input number as post body
|
||||
try {
|
||||
val result : java.math.BigDecimal = apiInstance.fakeOuterNumberSerialize(body)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#fakeOuterNumberSerialize")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#fakeOuterNumberSerialize")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **java.math.BigDecimal**| Input number as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
[**java.math.BigDecimal**](java.math.BigDecimal.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="fakeOuterStringSerialize"></a>
|
||||
# **fakeOuterStringSerialize**
|
||||
> kotlin.String fakeOuterStringSerialize(body)
|
||||
|
||||
|
||||
|
||||
Test serialization of outer string types
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val body : kotlin.String = body_example // kotlin.String | Input string as post body
|
||||
try {
|
||||
val result : kotlin.String = apiInstance.fakeOuterStringSerialize(body)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#fakeOuterStringSerialize")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#fakeOuterStringSerialize")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**body** | **kotlin.String**| Input string as post body | [optional]
|
||||
|
||||
### Return type
|
||||
|
||||
**kotlin.String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: */*
|
||||
|
||||
<a name="testBodyWithFileSchema"></a>
|
||||
# **testBodyWithFileSchema**
|
||||
> testBodyWithFileSchema(fileSchemaTestClass)
|
||||
|
||||
|
||||
|
||||
For this test, the body for this request much reference a schema named `File`.
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val fileSchemaTestClass : FileSchemaTestClass = // FileSchemaTestClass |
|
||||
try {
|
||||
apiInstance.testBodyWithFileSchema(fileSchemaTestClass)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#testBodyWithFileSchema")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#testBodyWithFileSchema")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**fileSchemaTestClass** | [**FileSchemaTestClass**](FileSchemaTestClass.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testBodyWithQueryParams"></a>
|
||||
# **testBodyWithQueryParams**
|
||||
> testBodyWithQueryParams(query, user)
|
||||
|
||||
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val query : kotlin.String = query_example // kotlin.String |
|
||||
val user : User = // User |
|
||||
try {
|
||||
apiInstance.testBodyWithQueryParams(query, user)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#testBodyWithQueryParams")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#testBodyWithQueryParams")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**query** | **kotlin.String**| | [default to null]
|
||||
**user** | [**User**](User.md)| |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testClientModel"></a>
|
||||
# **testClientModel**
|
||||
> Client testClientModel(client)
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
To test \"client\" model
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val client : Client = // Client | client model
|
||||
try {
|
||||
val result : Client = apiInstance.testClientModel(client)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#testClientModel")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#testClientModel")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="testEndpointParameters"></a>
|
||||
# **testEndpointParameters**
|
||||
> testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback)
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val number : java.math.BigDecimal = 1.2 // java.math.BigDecimal | None
|
||||
val double : kotlin.Double = 1.2 // kotlin.Double | None
|
||||
val patternWithoutDelimiter : kotlin.String = patternWithoutDelimiter_example // kotlin.String | None
|
||||
val byte : kotlin.ByteArray = BYTE_ARRAY_DATA_HERE // kotlin.ByteArray | None
|
||||
val integer : kotlin.Int = 56 // kotlin.Int | None
|
||||
val int32 : kotlin.Int = 56 // kotlin.Int | None
|
||||
val int64 : kotlin.Long = 789 // kotlin.Long | None
|
||||
val float : kotlin.Float = 3.4 // kotlin.Float | None
|
||||
val string : kotlin.String = string_example // kotlin.String | None
|
||||
val binary : java.io.File = BINARY_DATA_HERE // java.io.File | None
|
||||
val date : java.time.LocalDateTime = 2013-10-20 // java.time.LocalDateTime | None
|
||||
val dateTime : java.time.LocalDateTime = 2013-10-20T19:20:30+01:00 // java.time.LocalDateTime | None
|
||||
val password : kotlin.String = password_example // kotlin.String | None
|
||||
val paramCallback : kotlin.String = paramCallback_example // kotlin.String | None
|
||||
try {
|
||||
apiInstance.testEndpointParameters(number, double, patternWithoutDelimiter, byte, integer, int32, int64, float, string, binary, date, dateTime, password, paramCallback)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#testEndpointParameters")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#testEndpointParameters")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**number** | **java.math.BigDecimal**| None | [default to null]
|
||||
**double** | **kotlin.Double**| None | [default to null]
|
||||
**patternWithoutDelimiter** | **kotlin.String**| None | [default to null]
|
||||
**byte** | **kotlin.ByteArray**| None | [default to null]
|
||||
**integer** | **kotlin.Int**| None | [optional] [default to null]
|
||||
**int32** | **kotlin.Int**| None | [optional] [default to null]
|
||||
**int64** | **kotlin.Long**| None | [optional] [default to null]
|
||||
**float** | **kotlin.Float**| None | [optional] [default to null]
|
||||
**string** | **kotlin.String**| None | [optional] [default to null]
|
||||
**binary** | **java.io.File**| None | [optional] [default to null]
|
||||
**date** | **java.time.LocalDateTime**| None | [optional] [default to null]
|
||||
**dateTime** | **java.time.LocalDateTime**| None | [optional] [default to null]
|
||||
**password** | **kotlin.String**| None | [optional] [default to null]
|
||||
**paramCallback** | **kotlin.String**| None | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[http_basic_test](../README.md#http_basic_test)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testEnumParameters"></a>
|
||||
# **testEnumParameters**
|
||||
> testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
|
||||
|
||||
To test enum parameters
|
||||
|
||||
To test enum parameters
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val enumHeaderStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Header parameter enum test (string array)
|
||||
val enumHeaderString : kotlin.String = enumHeaderString_example // kotlin.String | Header parameter enum test (string)
|
||||
val enumQueryStringArray : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Query parameter enum test (string array)
|
||||
val enumQueryString : kotlin.String = enumQueryString_example // kotlin.String | Query parameter enum test (string)
|
||||
val enumQueryInteger : kotlin.Int = 56 // kotlin.Int | Query parameter enum test (double)
|
||||
val enumQueryDouble : kotlin.Double = 1.2 // kotlin.Double | Query parameter enum test (double)
|
||||
val enumFormStringArray : kotlin.Array<kotlin.String> = enumFormStringArray_example // kotlin.Array<kotlin.String> | Form parameter enum test (string array)
|
||||
val enumFormString : kotlin.String = enumFormString_example // kotlin.String | Form parameter enum test (string)
|
||||
try {
|
||||
apiInstance.testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#testEnumParameters")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#testEnumParameters")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**enumHeaderStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Header parameter enum test (string array) | [optional] [default to null] [enum: >, $]
|
||||
**enumHeaderString** | **kotlin.String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||
**enumQueryStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Query parameter enum test (string array) | [optional] [default to null] [enum: >, $]
|
||||
**enumQueryString** | **kotlin.String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||
**enumQueryInteger** | **kotlin.Int**| Query parameter enum test (double) | [optional] [default to null] [enum: 1, -2]
|
||||
**enumQueryDouble** | **kotlin.Double**| Query parameter enum test (double) | [optional] [default to null] [enum: 1.1, -1.2]
|
||||
**enumFormStringArray** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Form parameter enum test (string array) | [optional] [default to $] [enum: >, $]
|
||||
**enumFormString** | **kotlin.String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testGroupParameters"></a>
|
||||
# **testGroupParameters**
|
||||
> testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
|
||||
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
Fake endpoint to test group parameters (optional)
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val requiredStringGroup : kotlin.Int = 56 // kotlin.Int | Required String in group parameters
|
||||
val requiredBooleanGroup : kotlin.Boolean = true // kotlin.Boolean | Required Boolean in group parameters
|
||||
val requiredInt64Group : kotlin.Long = 789 // kotlin.Long | Required Integer in group parameters
|
||||
val stringGroup : kotlin.Int = 56 // kotlin.Int | String in group parameters
|
||||
val booleanGroup : kotlin.Boolean = true // kotlin.Boolean | Boolean in group parameters
|
||||
val int64Group : kotlin.Long = 789 // kotlin.Long | Integer in group parameters
|
||||
try {
|
||||
apiInstance.testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#testGroupParameters")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#testGroupParameters")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**requiredStringGroup** | **kotlin.Int**| Required String in group parameters | [default to null]
|
||||
**requiredBooleanGroup** | **kotlin.Boolean**| Required Boolean in group parameters | [default to null]
|
||||
**requiredInt64Group** | **kotlin.Long**| Required Integer in group parameters | [default to null]
|
||||
**stringGroup** | **kotlin.Int**| String in group parameters | [optional] [default to null]
|
||||
**booleanGroup** | **kotlin.Boolean**| Boolean in group parameters | [optional] [default to null]
|
||||
**int64Group** | **kotlin.Long**| Integer in group parameters | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testInlineAdditionalProperties"></a>
|
||||
# **testInlineAdditionalProperties**
|
||||
> testInlineAdditionalProperties(requestBody)
|
||||
|
||||
test inline additionalProperties
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val requestBody : kotlin.collections.Map<kotlin.String, kotlin.String> = // kotlin.collections.Map<kotlin.String, kotlin.String> | request body
|
||||
try {
|
||||
apiInstance.testInlineAdditionalProperties(requestBody)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#testInlineAdditionalProperties")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#testInlineAdditionalProperties")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**requestBody** | [**kotlin.collections.Map<kotlin.String, kotlin.String>**](kotlin.String.md)| request body |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="testJsonFormData"></a>
|
||||
# **testJsonFormData**
|
||||
> testJsonFormData(param, param2)
|
||||
|
||||
test json serialization of form data
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeApi()
|
||||
val param : kotlin.String = param_example // kotlin.String | field1
|
||||
val param2 : kotlin.String = param2_example // kotlin.String | field2
|
||||
try {
|
||||
apiInstance.testJsonFormData(param, param2)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeApi#testJsonFormData")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeApi#testJsonFormData")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**param** | **kotlin.String**| field1 | [default to null]
|
||||
**param2** | **kotlin.String**| field2 | [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
@ -0,0 +1,56 @@
|
||||
# FakeClassnameTags123Api
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case
|
||||
|
||||
|
||||
<a name="testClassname"></a>
|
||||
# **testClassname**
|
||||
> Client testClassname(client)
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
To test class name in snake case
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = FakeClassnameTags123Api()
|
||||
val client : Client = // Client | client model
|
||||
try {
|
||||
val result : Client = apiInstance.testClassname(client)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling FakeClassnameTags123Api#testClassname")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling FakeClassnameTags123Api#testClassname")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**client** | [**Client**](Client.md)| client model |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Client**](Client.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key_query](../README.md#api_key_query)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/json
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# FileSchemaTestClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**file** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**files** | [**kotlin.Array<java.io.File>**](java.io.File.md) | | [optional]
|
||||
|
||||
|
||||
|
10
samples/openapi3/client/petstore/kotlin/docs/Foo.md
Normal file
10
samples/openapi3/client/petstore/kotlin/docs/Foo.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Foo
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
24
samples/openapi3/client/petstore/kotlin/docs/Format_test.md
Normal file
24
samples/openapi3/client/petstore/kotlin/docs/Format_test.md
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
# FormatTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**integer** | **kotlin.Int** | | [optional]
|
||||
**int32** | **kotlin.Int** | | [optional]
|
||||
**int64** | **kotlin.Long** | | [optional]
|
||||
**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | |
|
||||
**float** | **kotlin.Float** | | [optional]
|
||||
**double** | **kotlin.Double** | | [optional]
|
||||
**string** | **kotlin.String** | | [optional]
|
||||
**byte** | **kotlin.ByteArray** | |
|
||||
**binary** | [**java.io.File**](java.io.File.md) | | [optional]
|
||||
**date** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | |
|
||||
**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional]
|
||||
**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional]
|
||||
**password** | **kotlin.String** | |
|
||||
**patternWithDigits** | **kotlin.String** | A string that is a 10 digit number. Can have leading zeros. | [optional]
|
||||
**patternWithDigitsAndDelimiter** | **kotlin.String** | A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# HasOnlyReadOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **kotlin.String** | | [optional]
|
||||
**foo** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# InlineObject
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **kotlin.String** | Updated name of the pet | [optional]
|
||||
**status** | **kotlin.String** | Updated status of the pet | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# InlineObject1
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional]
|
||||
**file** | [**java.io.File**](java.io.File.md) | file to upload | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
|
||||
# InlineObject2
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**enumFormStringArray** | [**inline**](#kotlin.Array<EnumFormStringArrayEnum>) | Form parameter enum test (string array) | [optional]
|
||||
**enumFormString** | [**inline**](#EnumFormStringEnum) | Form parameter enum test (string) | [optional]
|
||||
|
||||
|
||||
<a name="kotlin.Array<EnumFormStringArrayEnum>"></a>
|
||||
## Enum: enum_form_string_array
|
||||
Name | Value
|
||||
---- | -----
|
||||
enumFormStringArray | >, $
|
||||
|
||||
|
||||
<a name="EnumFormStringEnum"></a>
|
||||
## Enum: enum_form_string
|
||||
Name | Value
|
||||
---- | -----
|
||||
enumFormString | _abc, -efg, (xyz)
|
||||
|
||||
|
||||
|
@ -0,0 +1,23 @@
|
||||
|
||||
# InlineObject3
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**integer** | **kotlin.Int** | None | [optional]
|
||||
**int32** | **kotlin.Int** | None | [optional]
|
||||
**int64** | **kotlin.Long** | None | [optional]
|
||||
**number** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | None |
|
||||
**float** | **kotlin.Float** | None | [optional]
|
||||
**double** | **kotlin.Double** | None |
|
||||
**string** | **kotlin.String** | None | [optional]
|
||||
**patternWithoutDelimiter** | **kotlin.String** | None |
|
||||
**byte** | **kotlin.ByteArray** | None |
|
||||
**binary** | [**java.io.File**](java.io.File.md) | None | [optional]
|
||||
**date** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | None | [optional]
|
||||
**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | None | [optional]
|
||||
**password** | **kotlin.String** | None | [optional]
|
||||
**callback** | **kotlin.String** | None | [optional]
|
||||
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# InlineObject4
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**param** | **kotlin.String** | field1 |
|
||||
**param2** | **kotlin.String** | field2 |
|
||||
|
||||
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# InlineObject5
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**additionalMetadata** | **kotlin.String** | Additional data to pass to server | [optional]
|
||||
**requiredFile** | [**java.io.File**](java.io.File.md) | file to upload |
|
||||
|
||||
|
||||
|
@ -0,0 +1,10 @@
|
||||
|
||||
# InlineResponseDefault
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**string** | [**Foo**](Foo.md) | | [optional]
|
||||
|
||||
|
||||
|
10
samples/openapi3/client/petstore/kotlin/docs/List.md
Normal file
10
samples/openapi3/client/petstore/kotlin/docs/List.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# List
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**`123list`** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
20
samples/openapi3/client/petstore/kotlin/docs/MapTest.md
Normal file
20
samples/openapi3/client/petstore/kotlin/docs/MapTest.md
Normal file
@ -0,0 +1,20 @@
|
||||
|
||||
# MapTest
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**mapMapOfString** | **kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>** | | [optional]
|
||||
**mapOfEnumString** | [**inline**](#kotlin.collections.Map<kotlin.String, `inner`Enum>) | | [optional]
|
||||
**directMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional]
|
||||
**indirectMap** | **kotlin.collections.Map<kotlin.String, kotlin.Boolean>** | | [optional]
|
||||
|
||||
|
||||
<a name="kotlin.collections.Map<kotlin.String, `inner`Enum>"></a>
|
||||
## Enum: map_of_enum_string
|
||||
Name | Value
|
||||
---- | -----
|
||||
mapOfEnumString | UPPER, lower
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
# MixedPropertiesAndAdditionalPropertiesClass
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**uuid** | [**java.util.UUID**](java.util.UUID.md) | | [optional]
|
||||
**dateTime** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional]
|
||||
**map** | [**kotlin.collections.Map<kotlin.String, Animal>**](Animal.md) | | [optional]
|
||||
|
||||
|
||||
|
13
samples/openapi3/client/petstore/kotlin/docs/Name.md
Normal file
13
samples/openapi3/client/petstore/kotlin/docs/Name.md
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
# Name
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**name** | **kotlin.Int** | |
|
||||
**snakeCase** | **kotlin.Int** | | [optional]
|
||||
**property** | **kotlin.String** | | [optional]
|
||||
**`123number`** | **kotlin.Int** | | [optional]
|
||||
|
||||
|
||||
|
10
samples/openapi3/client/petstore/kotlin/docs/NumberOnly.md
Normal file
10
samples/openapi3/client/petstore/kotlin/docs/NumberOnly.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# NumberOnly
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**justNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
|
||||
|
||||
|
||||
|
22
samples/openapi3/client/petstore/kotlin/docs/Order.md
Normal file
22
samples/openapi3/client/petstore/kotlin/docs/Order.md
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
# Order
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **kotlin.Long** | | [optional]
|
||||
**petId** | **kotlin.Long** | | [optional]
|
||||
**quantity** | **kotlin.Int** | | [optional]
|
||||
**shipDate** | [**java.time.LocalDateTime**](java.time.LocalDateTime.md) | | [optional]
|
||||
**status** | [**inline**](#StatusEnum) | Order Status | [optional]
|
||||
**complete** | **kotlin.Boolean** | | [optional]
|
||||
|
||||
|
||||
<a name="StatusEnum"></a>
|
||||
## Enum: status
|
||||
Name | Value
|
||||
---- | -----
|
||||
status | placed, approved, delivered
|
||||
|
||||
|
||||
|
@ -0,0 +1,12 @@
|
||||
|
||||
# OuterComposite
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**myNumber** | [**java.math.BigDecimal**](java.math.BigDecimal.md) | | [optional]
|
||||
**myString** | **kotlin.String** | | [optional]
|
||||
**myBoolean** | **kotlin.Boolean** | | [optional]
|
||||
|
||||
|
||||
|
14
samples/openapi3/client/petstore/kotlin/docs/OuterEnum.md
Normal file
14
samples/openapi3/client/petstore/kotlin/docs/OuterEnum.md
Normal file
@ -0,0 +1,14 @@
|
||||
|
||||
# OuterEnum
|
||||
|
||||
## Enum
|
||||
|
||||
|
||||
* `placed` (value: `"placed"`)
|
||||
|
||||
* `approved` (value: `"approved"`)
|
||||
|
||||
* `delivered` (value: `"delivered"`)
|
||||
|
||||
|
||||
|
22
samples/openapi3/client/petstore/kotlin/docs/Pet.md
Normal file
22
samples/openapi3/client/petstore/kotlin/docs/Pet.md
Normal file
@ -0,0 +1,22 @@
|
||||
|
||||
# Pet
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **kotlin.Long** | | [optional]
|
||||
**category** | [**Category**](Category.md) | | [optional]
|
||||
**name** | **kotlin.String** | |
|
||||
**photoUrls** | **kotlin.Array<kotlin.String>** | |
|
||||
**tags** | [**kotlin.Array<Tag>**](Tag.md) | | [optional]
|
||||
**status** | [**inline**](#StatusEnum) | pet status in the store | [optional]
|
||||
|
||||
|
||||
<a name="StatusEnum"></a>
|
||||
## Enum: status
|
||||
Name | Value
|
||||
---- | -----
|
||||
status | available, pending, sold
|
||||
|
||||
|
||||
|
438
samples/openapi3/client/petstore/kotlin/docs/PetApi.md
Normal file
438
samples/openapi3/client/petstore/kotlin/docs/PetApi.md
Normal file
@ -0,0 +1,438 @@
|
||||
# PetApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store
|
||||
[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet
|
||||
[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status
|
||||
[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags
|
||||
[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID
|
||||
[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet
|
||||
[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data
|
||||
[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image
|
||||
[**uploadFileWithRequiredFile**](PetApi.md#uploadFileWithRequiredFile) | **POST** /fake/{petId}/uploadImageWithRequiredFile | uploads an image (required)
|
||||
|
||||
|
||||
<a name="addPet"></a>
|
||||
# **addPet**
|
||||
> addPet(pet)
|
||||
|
||||
Add a new pet to the store
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = PetApi()
|
||||
val pet : Pet = // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
apiInstance.addPet(pet)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#addPet")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#addPet")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="deletePet"></a>
|
||||
# **deletePet**
|
||||
> deletePet(petId, apiKey)
|
||||
|
||||
Deletes a pet
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = PetApi()
|
||||
val petId : kotlin.Long = 789 // kotlin.Long | Pet id to delete
|
||||
val apiKey : kotlin.String = apiKey_example // kotlin.String |
|
||||
try {
|
||||
apiInstance.deletePet(petId, apiKey)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#deletePet")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#deletePet")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **kotlin.Long**| Pet id to delete | [default to null]
|
||||
**apiKey** | **kotlin.String**| | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="findPetsByStatus"></a>
|
||||
# **findPetsByStatus**
|
||||
> kotlin.Array<Pet> findPetsByStatus(status)
|
||||
|
||||
Finds Pets by status
|
||||
|
||||
Multiple status values can be provided with comma separated strings
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = PetApi()
|
||||
val status : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Status values that need to be considered for filter
|
||||
try {
|
||||
val result : kotlin.Array<Pet> = apiInstance.findPetsByStatus(status)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#findPetsByStatus")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#findPetsByStatus")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**status** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Status values that need to be considered for filter | [default to null] [enum: available, pending, sold]
|
||||
|
||||
### Return type
|
||||
|
||||
[**kotlin.Array<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="findPetsByTags"></a>
|
||||
# **findPetsByTags**
|
||||
> kotlin.Array<Pet> findPetsByTags(tags)
|
||||
|
||||
Finds Pets by tags
|
||||
|
||||
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = PetApi()
|
||||
val tags : kotlin.Array<kotlin.String> = // kotlin.Array<kotlin.String> | Tags to filter by
|
||||
try {
|
||||
val result : kotlin.Array<Pet> = apiInstance.findPetsByTags(tags)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#findPetsByTags")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#findPetsByTags")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**tags** | [**kotlin.Array<kotlin.String>**](kotlin.String.md)| Tags to filter by | [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
[**kotlin.Array<Pet>**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="getPetById"></a>
|
||||
# **getPetById**
|
||||
> Pet getPetById(petId)
|
||||
|
||||
Find pet by ID
|
||||
|
||||
Returns a single pet
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = PetApi()
|
||||
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to return
|
||||
try {
|
||||
val result : Pet = apiInstance.getPetById(petId)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#getPetById")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#getPetById")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **kotlin.Long**| ID of pet to return | [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Pet**](Pet.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="updatePet"></a>
|
||||
# **updatePet**
|
||||
> updatePet(pet)
|
||||
|
||||
Update an existing pet
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = PetApi()
|
||||
val pet : Pet = // Pet | Pet object that needs to be added to the store
|
||||
try {
|
||||
apiInstance.updatePet(pet)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#updatePet")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#updatePet")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**pet** | [**Pet**](Pet.md)| Pet object that needs to be added to the store |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json, application/xml
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="updatePetWithForm"></a>
|
||||
# **updatePetWithForm**
|
||||
> updatePetWithForm(petId, name, status)
|
||||
|
||||
Updates a pet in the store with form data
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = PetApi()
|
||||
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.String = status_example // kotlin.String | Updated status of the pet
|
||||
try {
|
||||
apiInstance.updatePetWithForm(petId, name, status)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#updatePetWithForm")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#updatePetWithForm")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **kotlin.Long**| ID of pet that needs to be updated | [default to null]
|
||||
**name** | **kotlin.String**| Updated name of the pet | [optional] [default to null]
|
||||
**status** | **kotlin.String**| Updated status of the pet | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/x-www-form-urlencoded
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="uploadFile"></a>
|
||||
# **uploadFile**
|
||||
> ApiResponse uploadFile(petId, additionalMetadata, file)
|
||||
|
||||
uploads an image
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
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 = BINARY_DATA_HERE // java.io.File | file to upload
|
||||
try {
|
||||
val result : ApiResponse = apiInstance.uploadFile(petId, additionalMetadata, file)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#uploadFile")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#uploadFile")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **kotlin.Long**| ID of pet to update | [default to null]
|
||||
**additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] [default to null]
|
||||
**file** | **java.io.File**| file to upload | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ApiResponse**](ApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="uploadFileWithRequiredFile"></a>
|
||||
# **uploadFileWithRequiredFile**
|
||||
> ApiResponse uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
|
||||
|
||||
uploads an image (required)
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = PetApi()
|
||||
val petId : kotlin.Long = 789 // kotlin.Long | ID of pet to update
|
||||
val requiredFile : java.io.File = BINARY_DATA_HERE // java.io.File | file to upload
|
||||
val additionalMetadata : kotlin.String = additionalMetadata_example // kotlin.String | Additional data to pass to server
|
||||
try {
|
||||
val result : ApiResponse = apiInstance.uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling PetApi#uploadFileWithRequiredFile")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling PetApi#uploadFileWithRequiredFile")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**petId** | **kotlin.Long**| ID of pet to update | [default to null]
|
||||
**requiredFile** | **java.io.File**| file to upload | [default to null]
|
||||
**additionalMetadata** | **kotlin.String**| Additional data to pass to server | [optional] [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
[**ApiResponse**](ApiResponse.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
[petstore_auth](../README.md#petstore_auth)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: multipart/form-data
|
||||
- **Accept**: application/json
|
||||
|
@ -0,0 +1,11 @@
|
||||
|
||||
# ReadOnlyFirst
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**bar** | **kotlin.String** | | [optional]
|
||||
**baz** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
10
samples/openapi3/client/petstore/kotlin/docs/Return.md
Normal file
10
samples/openapi3/client/petstore/kotlin/docs/Return.md
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
# Return
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**`return`** | **kotlin.Int** | | [optional]
|
||||
|
||||
|
||||
|
193
samples/openapi3/client/petstore/kotlin/docs/StoreApi.md
Normal file
193
samples/openapi3/client/petstore/kotlin/docs/StoreApi.md
Normal file
@ -0,0 +1,193 @@
|
||||
# StoreApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID
|
||||
[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status
|
||||
[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID
|
||||
[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet
|
||||
|
||||
|
||||
<a name="deleteOrder"></a>
|
||||
# **deleteOrder**
|
||||
> deleteOrder(orderId)
|
||||
|
||||
Delete purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = StoreApi()
|
||||
val orderId : kotlin.String = orderId_example // kotlin.String | ID of the order that needs to be deleted
|
||||
try {
|
||||
apiInstance.deleteOrder(orderId)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling StoreApi#deleteOrder")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling StoreApi#deleteOrder")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **kotlin.String**| ID of the order that needs to be deleted | [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="getInventory"></a>
|
||||
# **getInventory**
|
||||
> kotlin.collections.Map<kotlin.String, kotlin.Int> getInventory()
|
||||
|
||||
Returns pet inventories by status
|
||||
|
||||
Returns a map of status codes to quantities
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = StoreApi()
|
||||
try {
|
||||
val result : kotlin.collections.Map<kotlin.String, kotlin.Int> = apiInstance.getInventory()
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling StoreApi#getInventory")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling StoreApi#getInventory")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
**kotlin.collections.Map<kotlin.String, kotlin.Int>**
|
||||
|
||||
### Authorization
|
||||
|
||||
[api_key](../README.md#api_key)
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/json
|
||||
|
||||
<a name="getOrderById"></a>
|
||||
# **getOrderById**
|
||||
> Order getOrderById(orderId)
|
||||
|
||||
Find purchase order by ID
|
||||
|
||||
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = StoreApi()
|
||||
val orderId : kotlin.Long = 789 // kotlin.Long | ID of pet that needs to be fetched
|
||||
try {
|
||||
val result : Order = apiInstance.getOrderById(orderId)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling StoreApi#getOrderById")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling StoreApi#getOrderById")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**orderId** | **kotlin.Long**| ID of pet that needs to be fetched | [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
[**Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="placeOrder"></a>
|
||||
# **placeOrder**
|
||||
> Order placeOrder(order)
|
||||
|
||||
Place an order for a pet
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = StoreApi()
|
||||
val order : Order = // Order | order placed for purchasing the pet
|
||||
try {
|
||||
val result : Order = apiInstance.placeOrder(order)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling StoreApi#placeOrder")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling StoreApi#placeOrder")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**order** | [**Order**](Order.md)| order placed for purchasing the pet |
|
||||
|
||||
### Return type
|
||||
|
||||
[**Order**](Order.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: application/xml, application/json
|
||||
|
11
samples/openapi3/client/petstore/kotlin/docs/Tag.md
Normal file
11
samples/openapi3/client/petstore/kotlin/docs/Tag.md
Normal file
@ -0,0 +1,11 @@
|
||||
|
||||
# Tag
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **kotlin.Long** | | [optional]
|
||||
**name** | **kotlin.String** | | [optional]
|
||||
|
||||
|
||||
|
17
samples/openapi3/client/petstore/kotlin/docs/User.md
Normal file
17
samples/openapi3/client/petstore/kotlin/docs/User.md
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
# User
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**id** | **kotlin.Long** | | [optional]
|
||||
**username** | **kotlin.String** | | [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]
|
||||
|
||||
|
||||
|
376
samples/openapi3/client/petstore/kotlin/docs/UserApi.md
Normal file
376
samples/openapi3/client/petstore/kotlin/docs/UserApi.md
Normal file
@ -0,0 +1,376 @@
|
||||
# UserApi
|
||||
|
||||
All URIs are relative to *http://petstore.swagger.io:80/v2*
|
||||
|
||||
Method | HTTP request | Description
|
||||
------------- | ------------- | -------------
|
||||
[**createUser**](UserApi.md#createUser) | **POST** /user | Create user
|
||||
[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array
|
||||
[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array
|
||||
[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user
|
||||
[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name
|
||||
[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system
|
||||
[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session
|
||||
[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user
|
||||
|
||||
|
||||
<a name="createUser"></a>
|
||||
# **createUser**
|
||||
> createUser(user)
|
||||
|
||||
Create user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = UserApi()
|
||||
val user : User = // User | Created user object
|
||||
try {
|
||||
apiInstance.createUser(user)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling UserApi#createUser")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling UserApi#createUser")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**User**](User.md)| Created user object |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="createUsersWithArrayInput"></a>
|
||||
# **createUsersWithArrayInput**
|
||||
> createUsersWithArrayInput(user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = UserApi()
|
||||
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
|
||||
try {
|
||||
apiInstance.createUsersWithArrayInput(user)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling UserApi#createUsersWithArrayInput")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling UserApi#createUsersWithArrayInput")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="createUsersWithListInput"></a>
|
||||
# **createUsersWithListInput**
|
||||
> createUsersWithListInput(user)
|
||||
|
||||
Creates list of users with given input array
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = UserApi()
|
||||
val user : kotlin.Array<User> = // kotlin.Array<User> | List of user object
|
||||
try {
|
||||
apiInstance.createUsersWithListInput(user)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling UserApi#createUsersWithListInput")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling UserApi#createUsersWithListInput")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**user** | [**kotlin.Array<User>**](kotlin.Array.md)| List of user object |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="deleteUser"></a>
|
||||
# **deleteUser**
|
||||
> deleteUser(username)
|
||||
|
||||
Delete user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = UserApi()
|
||||
val username : kotlin.String = username_example // kotlin.String | The name that needs to be deleted
|
||||
try {
|
||||
apiInstance.deleteUser(username)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling UserApi#deleteUser")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling UserApi#deleteUser")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **kotlin.String**| The name that needs to be deleted | [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="getUserByName"></a>
|
||||
# **getUserByName**
|
||||
> User getUserByName(username)
|
||||
|
||||
Get user by user name
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = UserApi()
|
||||
val username : kotlin.String = username_example // kotlin.String | The name that needs to be fetched. Use user1 for testing.
|
||||
try {
|
||||
val result : User = apiInstance.getUserByName(username)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling UserApi#getUserByName")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling UserApi#getUserByName")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **kotlin.String**| The name that needs to be fetched. Use user1 for testing. | [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
[**User**](User.md)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="loginUser"></a>
|
||||
# **loginUser**
|
||||
> kotlin.String loginUser(username, password)
|
||||
|
||||
Logs user into the system
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = UserApi()
|
||||
val username : kotlin.String = username_example // kotlin.String | The user name for login
|
||||
val password : kotlin.String = password_example // kotlin.String | The password for login in clear text
|
||||
try {
|
||||
val result : kotlin.String = apiInstance.loginUser(username, password)
|
||||
println(result)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling UserApi#loginUser")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling UserApi#loginUser")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **kotlin.String**| The user name for login | [default to null]
|
||||
**password** | **kotlin.String**| The password for login in clear text | [default to null]
|
||||
|
||||
### Return type
|
||||
|
||||
**kotlin.String**
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: application/xml, application/json
|
||||
|
||||
<a name="logoutUser"></a>
|
||||
# **logoutUser**
|
||||
> logoutUser()
|
||||
|
||||
Logs out current logged in user session
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = UserApi()
|
||||
try {
|
||||
apiInstance.logoutUser()
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling UserApi#logoutUser")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling UserApi#logoutUser")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
This endpoint does not need any parameter.
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: Not defined
|
||||
- **Accept**: Not defined
|
||||
|
||||
<a name="updateUser"></a>
|
||||
# **updateUser**
|
||||
> updateUser(username, user)
|
||||
|
||||
Updated user
|
||||
|
||||
This can only be done by the logged in user.
|
||||
|
||||
### Example
|
||||
```kotlin
|
||||
// Import classes:
|
||||
//import org.openapitools.client.infrastructure.*
|
||||
//import org.openapitools.client.models.*
|
||||
|
||||
val apiInstance = UserApi()
|
||||
val username : kotlin.String = username_example // kotlin.String | name that need to be deleted
|
||||
val user : User = // User | Updated user object
|
||||
try {
|
||||
apiInstance.updateUser(username, user)
|
||||
} catch (e: ClientException) {
|
||||
println("4xx response calling UserApi#updateUser")
|
||||
e.printStackTrace()
|
||||
} catch (e: ServerException) {
|
||||
println("5xx response calling UserApi#updateUser")
|
||||
e.printStackTrace()
|
||||
}
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
Name | Type | Description | Notes
|
||||
------------- | ------------- | ------------- | -------------
|
||||
**username** | **kotlin.String**| name that need to be deleted | [default to null]
|
||||
**user** | [**User**](User.md)| Updated user object |
|
||||
|
||||
### Return type
|
||||
|
||||
null (empty response body)
|
||||
|
||||
### Authorization
|
||||
|
||||
No authorization required
|
||||
|
||||
### HTTP request headers
|
||||
|
||||
- **Content-Type**: application/json
|
||||
- **Accept**: Not defined
|
||||
|
@ -0,0 +1,10 @@
|
||||
|
||||
# SpecialModelname
|
||||
|
||||
## Properties
|
||||
Name | Type | Description | Notes
|
||||
------------ | ------------- | ------------- | -------------
|
||||
**`$specialPropertyName`** | **kotlin.Long** | | [optional]
|
||||
|
||||
|
||||
|
1
samples/openapi3/client/petstore/kotlin/settings.gradle
Normal file
1
samples/openapi3/client/petstore/kotlin/settings.gradle
Normal file
@ -0,0 +1 @@
|
||||
rootProject.name = 'kotlin-petstore-client'
|
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import org.openapitools.client.models.Client
|
||||
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
class AnotherFakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) {
|
||||
|
||||
/**
|
||||
* To test special tags
|
||||
* To test special tags and operation ID starting with number
|
||||
* @param client client model
|
||||
* @return Client
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun call123testSpecialTags(client: Client) : Client {
|
||||
val localVariableBody: kotlin.Any? = client
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.PATCH,
|
||||
"/another-fake/dummy",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Client>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as Client
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import org.openapitools.client.models.InlineResponseDefault
|
||||
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
class DefaultApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @return InlineResponseDefault
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun fooGet() : InlineResponseDefault {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/foo",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<InlineResponseDefault>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as InlineResponseDefault
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,427 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import org.openapitools.client.models.Client
|
||||
import org.openapitools.client.models.FileSchemaTestClass
|
||||
import org.openapitools.client.models.OuterComposite
|
||||
import org.openapitools.client.models.User
|
||||
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
class FakeApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) {
|
||||
|
||||
/**
|
||||
*
|
||||
* Test serialization of outer boolean types
|
||||
* @param body Input boolean as post body (optional)
|
||||
* @return kotlin.Boolean
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun fakeOuterBooleanSerialize(body: kotlin.Boolean) : kotlin.Boolean {
|
||||
val localVariableBody: kotlin.Any? = body
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/fake/outer/boolean",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<kotlin.Boolean>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as kotlin.Boolean
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Test serialization of object with outer number type
|
||||
* @param outerComposite Input composite as post body (optional)
|
||||
* @return OuterComposite
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun fakeOuterCompositeSerialize(outerComposite: OuterComposite) : OuterComposite {
|
||||
val localVariableBody: kotlin.Any? = outerComposite
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/fake/outer/composite",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<OuterComposite>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as OuterComposite
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Test serialization of outer number types
|
||||
* @param body Input number as post body (optional)
|
||||
* @return java.math.BigDecimal
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun fakeOuterNumberSerialize(body: java.math.BigDecimal) : java.math.BigDecimal {
|
||||
val localVariableBody: kotlin.Any? = body
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/fake/outer/number",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<java.math.BigDecimal>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as java.math.BigDecimal
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Test serialization of outer string types
|
||||
* @param body Input string as post body (optional)
|
||||
* @return kotlin.String
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun fakeOuterStringSerialize(body: kotlin.String) : kotlin.String {
|
||||
val localVariableBody: kotlin.Any? = body
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/fake/outer/string",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<kotlin.String>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as kotlin.String
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* For this test, the body for this request much reference a schema named `File`.
|
||||
* @param fileSchemaTestClass
|
||||
* @return void
|
||||
*/
|
||||
fun testBodyWithFileSchema(fileSchemaTestClass: FileSchemaTestClass) : Unit {
|
||||
val localVariableBody: kotlin.Any? = fileSchemaTestClass
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.PUT,
|
||||
"/fake/body-with-file-schema",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param query
|
||||
* @param user
|
||||
* @return void
|
||||
*/
|
||||
fun testBodyWithQueryParams(query: kotlin.String, user: User) : Unit {
|
||||
val localVariableBody: kotlin.Any? = user
|
||||
val localVariableQuery: MultiValueMap = mapOf("query" to listOf("$query"))
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.PUT,
|
||||
"/fake/body-with-query-params",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To test \"client\" model
|
||||
* To test \"client\" model
|
||||
* @param client client model
|
||||
* @return Client
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun testClientModel(client: Client) : Client {
|
||||
val localVariableBody: kotlin.Any? = client
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.PATCH,
|
||||
"/fake",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Client>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as Client
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
|
||||
* @param number None
|
||||
* @param double None
|
||||
* @param patternWithoutDelimiter None
|
||||
* @param byte None
|
||||
* @param integer None (optional, default to null)
|
||||
* @param int32 None (optional, default to null)
|
||||
* @param int64 None (optional, default to null)
|
||||
* @param float None (optional, default to null)
|
||||
* @param string None (optional, default to null)
|
||||
* @param binary None (optional, default to null)
|
||||
* @param date None (optional, default to null)
|
||||
* @param dateTime None (optional, default to null)
|
||||
* @param password None (optional, default to null)
|
||||
* @param paramCallback None (optional, default to null)
|
||||
* @return void
|
||||
*/
|
||||
fun testEndpointParameters(number: java.math.BigDecimal, double: kotlin.Double, patternWithoutDelimiter: kotlin.String, byte: kotlin.ByteArray, integer: kotlin.Int, int32: kotlin.Int, int64: kotlin.Long, float: kotlin.Float, string: kotlin.String, binary: java.io.File, date: java.time.LocalDateTime, dateTime: java.time.LocalDateTime, password: kotlin.String, paramCallback: kotlin.String) : Unit {
|
||||
val localVariableBody: kotlin.Any? = mapOf("integer" to "$integer", "int32" to "$int32", "int64" to "$int64", "number" to "$number", "float" to "$float", "double" to "$double", "string" to "$string", "pattern_without_delimiter" to "$patternWithoutDelimiter", "byte" to "$byte", "binary" to "$binary", "date" to "$date", "dateTime" to "$dateTime", "password" to "$password", "callback" to "$paramCallback")
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("Content-Type" to "multipart/form-data")
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/fake",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To test enum parameters
|
||||
* To test enum parameters
|
||||
* @param enumHeaderStringArray Header parameter enum test (string array) (optional, default to null)
|
||||
* @param enumHeaderString Header parameter enum test (string) (optional, default to -efg)
|
||||
* @param enumQueryStringArray Query parameter enum test (string array) (optional, default to null)
|
||||
* @param enumQueryString Query parameter enum test (string) (optional, default to -efg)
|
||||
* @param enumQueryInteger Query parameter enum test (double) (optional, default to null)
|
||||
* @param enumQueryDouble Query parameter enum test (double) (optional, default to null)
|
||||
* @param enumFormStringArray Form parameter enum test (string array) (optional, default to $)
|
||||
* @param enumFormString Form parameter enum test (string) (optional, default to -efg)
|
||||
* @return void
|
||||
*/
|
||||
fun testEnumParameters(enumHeaderStringArray: kotlin.Array<kotlin.String>, enumHeaderString: kotlin.String, enumQueryStringArray: kotlin.Array<kotlin.String>, enumQueryString: kotlin.String, enumQueryInteger: kotlin.Int, enumQueryDouble: kotlin.Double, enumFormStringArray: kotlin.Array<kotlin.String>, enumFormString: kotlin.String) : Unit {
|
||||
val localVariableBody: kotlin.Any? = mapOf("enum_form_string_array" to "$enumFormStringArray", "enum_form_string" to "$enumFormString")
|
||||
val localVariableQuery: MultiValueMap = mapOf("enum_query_string_array" to toMultiValue(enumQueryStringArray.toList(), "multi"), "enum_query_string" to listOf("$enumQueryString"), "enum_query_integer" to listOf("$enumQueryInteger"), "enum_query_double" to listOf("$enumQueryDouble"))
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("Content-Type" to "multipart/form-data", "enum_header_string_array" to enumHeaderStringArray.joinToString(separator = collectionDelimiter("csv")), "enum_header_string" to enumHeaderString)
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/fake",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
* Fake endpoint to test group parameters (optional)
|
||||
* @param requiredStringGroup Required String in group parameters
|
||||
* @param requiredBooleanGroup Required Boolean in group parameters
|
||||
* @param requiredInt64Group Required Integer in group parameters
|
||||
* @param stringGroup String in group parameters (optional, default to null)
|
||||
* @param booleanGroup Boolean in group parameters (optional, default to null)
|
||||
* @param int64Group Integer in group parameters (optional, default to null)
|
||||
* @return void
|
||||
*/
|
||||
fun testGroupParameters(requiredStringGroup: kotlin.Int, requiredBooleanGroup: kotlin.Boolean, requiredInt64Group: kotlin.Long, stringGroup: kotlin.Int, booleanGroup: kotlin.Boolean, int64Group: kotlin.Long) : Unit {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf("required_string_group" to listOf("$requiredStringGroup"), "required_int64_group" to listOf("$requiredInt64Group"), "string_group" to listOf("$stringGroup"), "int64_group" to listOf("$int64Group"))
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("required_boolean_group" to requiredBooleanGroup, "boolean_group" to booleanGroup)
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.DELETE,
|
||||
"/fake",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* test inline additionalProperties
|
||||
*
|
||||
* @param requestBody request body
|
||||
* @return void
|
||||
*/
|
||||
fun testInlineAdditionalProperties(requestBody: kotlin.collections.Map<kotlin.String, kotlin.String>) : Unit {
|
||||
val localVariableBody: kotlin.Any? = requestBody
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/fake/inline-additionalProperties",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* test json serialization of form data
|
||||
*
|
||||
* @param param field1
|
||||
* @param param2 field2
|
||||
* @return void
|
||||
*/
|
||||
fun testJsonFormData(param: kotlin.String, param2: kotlin.String) : Unit {
|
||||
val localVariableBody: kotlin.Any? = mapOf("param" to "$param", "param2" to "$param2")
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("Content-Type" to "multipart/form-data")
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/fake/jsonFormData",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import org.openapitools.client.models.Client
|
||||
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
class FakeClassnameTags123Api(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) {
|
||||
|
||||
/**
|
||||
* To test class name in snake case
|
||||
* To test class name in snake case
|
||||
* @param client client model
|
||||
* @return Client
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun testClassname(client: Client) : Client {
|
||||
val localVariableBody: kotlin.Any? = client
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.PATCH,
|
||||
"/fake_classname_test",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Client>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as Client
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,312 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import org.openapitools.client.models.ApiResponse
|
||||
import org.openapitools.client.models.Pet
|
||||
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
class PetApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) {
|
||||
|
||||
/**
|
||||
* Add a new pet to the store
|
||||
*
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @return void
|
||||
*/
|
||||
fun addPet(pet: Pet) : Unit {
|
||||
val localVariableBody: kotlin.Any? = pet
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/pet",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a pet
|
||||
*
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey (optional, default to null)
|
||||
* @return void
|
||||
*/
|
||||
fun deletePet(petId: kotlin.Long, apiKey: kotlin.String) : Unit {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("api_key" to apiKey)
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.DELETE,
|
||||
"/pet/{petId}".replace("{"+"petId"+"}", "$petId"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by status
|
||||
* Multiple status values can be provided with comma separated strings
|
||||
* @param status Status values that need to be considered for filter
|
||||
* @return kotlin.Array<Pet>
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun findPetsByStatus(status: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf("status" to toMultiValue(status.toList(), "csv"))
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/pet/findByStatus",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<kotlin.Array<Pet>>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as kotlin.Array<Pet>
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds Pets by tags
|
||||
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
||||
* @param tags Tags to filter by
|
||||
* @return kotlin.Array<Pet>
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun findPetsByTags(tags: kotlin.Array<kotlin.String>) : kotlin.Array<Pet> {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf("tags" to toMultiValue(tags.toList(), "csv"))
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/pet/findByTags",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<kotlin.Array<Pet>>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as kotlin.Array<Pet>
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find pet by ID
|
||||
* Returns a single pet
|
||||
* @param petId ID of pet to return
|
||||
* @return Pet
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun getPetById(petId: kotlin.Long) : Pet {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/pet/{petId}".replace("{"+"petId"+"}", "$petId"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Pet>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as Pet
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an existing pet
|
||||
*
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @return void
|
||||
*/
|
||||
fun updatePet(pet: Pet) : Unit {
|
||||
val localVariableBody: kotlin.Any? = pet
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.PUT,
|
||||
"/pet",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a pet in the store with form data
|
||||
*
|
||||
* @param petId ID of pet that needs to be updated
|
||||
* @param name Updated name of the pet (optional, default to null)
|
||||
* @param status Updated status of the pet (optional, default to null)
|
||||
* @return void
|
||||
*/
|
||||
fun updatePetWithForm(petId: kotlin.Long, name: kotlin.String, status: kotlin.String) : Unit {
|
||||
val localVariableBody: kotlin.Any? = mapOf("name" to "$name", "status" to "$status")
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("Content-Type" to "multipart/form-data")
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/pet/{petId}".replace("{"+"petId"+"}", "$petId"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param additionalMetadata Additional data to pass to server (optional, default to null)
|
||||
* @param file file to upload (optional, default to null)
|
||||
* @return ApiResponse
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun uploadFile(petId: kotlin.Long, additionalMetadata: kotlin.String, file: java.io.File) : ApiResponse {
|
||||
val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "file" to "$file")
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("Content-Type" to "multipart/form-data")
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<ApiResponse>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as ApiResponse
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* uploads an image (required)
|
||||
*
|
||||
* @param petId ID of pet to update
|
||||
* @param requiredFile file to upload
|
||||
* @param additionalMetadata Additional data to pass to server (optional, default to null)
|
||||
* @return ApiResponse
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun uploadFileWithRequiredFile(petId: kotlin.Long, requiredFile: java.io.File, additionalMetadata: kotlin.String) : ApiResponse {
|
||||
val localVariableBody: kotlin.Any? = mapOf("additionalMetadata" to "$additionalMetadata", "requiredFile" to "$requiredFile")
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf("Content-Type" to "multipart/form-data")
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/fake/{petId}/uploadImageWithRequiredFile".replace("{"+"petId"+"}", "$petId"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<ApiResponse>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as ApiResponse
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import org.openapitools.client.models.Order
|
||||
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
class StoreApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) {
|
||||
|
||||
/**
|
||||
* Delete purchase order by ID
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
fun deleteOrder(orderId: kotlin.String) : Unit {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.DELETE,
|
||||
"/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
* @return kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun getInventory() : kotlin.collections.Map<kotlin.String, kotlin.Int> {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/store/inventory",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<kotlin.collections.Map<kotlin.String, kotlin.Int>>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as kotlin.collections.Map<kotlin.String, kotlin.Int>
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Find purchase order by ID
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @return Order
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun getOrderById(orderId: kotlin.Long) : Order {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/store/order/{order_id}".replace("{"+"order_id"+"}", "$orderId"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Order>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as Order
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Place an order for a pet
|
||||
*
|
||||
* @param order order placed for purchasing the pet
|
||||
* @return Order
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun placeOrder(order: Order) : Order {
|
||||
val localVariableBody: kotlin.Any? = order
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/store/order",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Order>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as Order
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,271 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.apis
|
||||
|
||||
import org.openapitools.client.models.User
|
||||
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
class UserApi(basePath: kotlin.String = "http://petstore.swagger.io:80/v2") : ApiClient(basePath) {
|
||||
|
||||
/**
|
||||
* Create user
|
||||
* This can only be done by the logged in user.
|
||||
* @param user Created user object
|
||||
* @return void
|
||||
*/
|
||||
fun createUser(user: User) : Unit {
|
||||
val localVariableBody: kotlin.Any? = user
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/user",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param user List of user object
|
||||
* @return void
|
||||
*/
|
||||
fun createUsersWithArrayInput(user: kotlin.Array<User>) : Unit {
|
||||
val localVariableBody: kotlin.Any? = user
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/user/createWithArray",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates list of users with given input array
|
||||
*
|
||||
* @param user List of user object
|
||||
* @return void
|
||||
*/
|
||||
fun createUsersWithListInput(user: kotlin.Array<User>) : Unit {
|
||||
val localVariableBody: kotlin.Any? = user
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.POST,
|
||||
"/user/createWithList",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username The name that needs to be deleted
|
||||
* @return void
|
||||
*/
|
||||
fun deleteUser(username: kotlin.String) : Unit {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.DELETE,
|
||||
"/user/{username}".replace("{"+"username"+"}", "$username"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user by user name
|
||||
*
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @return User
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun getUserByName(username: kotlin.String) : User {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/user/{username}".replace("{"+"username"+"}", "$username"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<User>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as User
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs user into the system
|
||||
*
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
* @return kotlin.String
|
||||
*/
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
fun loginUser(username: kotlin.String, password: kotlin.String) : kotlin.String {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf("username" to listOf("$username"), "password" to listOf("$password"))
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/user/login",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<kotlin.String>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> (response as Success<*>).data as kotlin.String
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out current logged in user session
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
fun logoutUser() : Unit {
|
||||
val localVariableBody: kotlin.Any? = null
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.GET,
|
||||
"/user/logout",
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Updated user
|
||||
* This can only be done by the logged in user.
|
||||
* @param username name that need to be deleted
|
||||
* @param user Updated user object
|
||||
* @return void
|
||||
*/
|
||||
fun updateUser(username: kotlin.String, user: User) : Unit {
|
||||
val localVariableBody: kotlin.Any? = user
|
||||
val localVariableQuery: MultiValueMap = mapOf()
|
||||
val localVariableHeaders: kotlin.collections.Map<kotlin.String,kotlin.String> = mapOf()
|
||||
val localVariableConfig = RequestConfig(
|
||||
RequestMethod.PUT,
|
||||
"/user/{username}".replace("{"+"username"+"}", "$username"),
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders
|
||||
)
|
||||
val response = request<Any?>(
|
||||
localVariableConfig,
|
||||
localVariableBody
|
||||
)
|
||||
|
||||
return when (response.responseType) {
|
||||
ResponseType.Success -> Unit
|
||||
ResponseType.Informational -> TODO()
|
||||
ResponseType.Redirection -> TODO()
|
||||
ResponseType.ClientError -> throw ClientException((response as ClientError<*>).body as? String ?: "Client error")
|
||||
ResponseType.ServerError -> throw ServerException((response as ServerError<*>).message ?: "Server error")
|
||||
else -> throw kotlin.IllegalStateException("Undefined ResponseType.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
typealias MultiValueMap = Map<String,List<String>>
|
||||
|
||||
fun collectionDelimiter(collectionFormat: String) = when(collectionFormat) {
|
||||
"csv" -> ","
|
||||
"tsv" -> "\t"
|
||||
"pipes" -> "|"
|
||||
"ssv" -> " "
|
||||
else -> ""
|
||||
}
|
||||
|
||||
val defaultMultiValueConverter: (item: Any?) -> String = { item -> "$item" }
|
||||
|
||||
fun <T: Any?> toMultiValue(items: List<T>, collectionFormat: String, map: (item: Any?) -> String = defaultMultiValueConverter): List<String> {
|
||||
return when(collectionFormat) {
|
||||
"multi" -> items.map(map)
|
||||
else -> listOf(items.map(map).joinToString(separator = collectionDelimiter(collectionFormat)))
|
||||
}
|
||||
}
|
@ -0,0 +1,130 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
import okhttp3.*
|
||||
import java.io.File
|
||||
|
||||
open class ApiClient(val baseUrl: String) {
|
||||
companion object {
|
||||
protected const val ContentType = "Content-Type"
|
||||
protected const val Accept = "Accept"
|
||||
protected const val JsonMediaType = "application/json"
|
||||
protected const val FormDataMediaType = "multipart/form-data"
|
||||
protected const val XmlMediaType = "application/xml"
|
||||
|
||||
@JvmStatic
|
||||
val client by lazy {
|
||||
builder.build()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
val builder: OkHttpClient.Builder = OkHttpClient.Builder()
|
||||
|
||||
@JvmStatic
|
||||
var defaultHeaders: Map<String, String> by ApplicationDelegates.setOnce(mapOf(ContentType to JsonMediaType, Accept to JsonMediaType))
|
||||
|
||||
@JvmStatic
|
||||
val jsonHeaders: Map<String, String> = mapOf(ContentType to JsonMediaType, Accept to JsonMediaType)
|
||||
}
|
||||
|
||||
protected inline fun <reified T> requestBody(content: T, mediaType: String = JsonMediaType): RequestBody =
|
||||
when {
|
||||
content is File -> RequestBody.create(
|
||||
MediaType.parse(mediaType), content
|
||||
)
|
||||
mediaType == FormDataMediaType -> {
|
||||
var builder = FormBody.Builder()
|
||||
// content's type *must* be Map<String, Any>
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
(content as Map<String,String>).forEach { key, value ->
|
||||
builder = builder.add(key, value)
|
||||
}
|
||||
builder.build()
|
||||
}
|
||||
mediaType == JsonMediaType -> RequestBody.create(
|
||||
MediaType.parse(mediaType), Serializer.moshi.adapter(T::class.java).toJson(content)
|
||||
)
|
||||
mediaType == XmlMediaType -> TODO("xml not currently supported.")
|
||||
// TODO: this should be extended with other serializers
|
||||
else -> TODO("requestBody currently only supports JSON body and File body.")
|
||||
}
|
||||
|
||||
protected inline fun <reified T: Any?> responseBody(body: ResponseBody?, mediaType: String = JsonMediaType): T? {
|
||||
if(body == null) return null
|
||||
return when(mediaType) {
|
||||
JsonMediaType -> Serializer.moshi.adapter(T::class.java).fromJson(body.source())
|
||||
else -> TODO()
|
||||
}
|
||||
}
|
||||
|
||||
protected inline fun <reified T: Any?> request(requestConfig: RequestConfig, body : Any? = null): ApiInfrastructureResponse<T?> {
|
||||
val httpUrl = HttpUrl.parse(baseUrl) ?: throw IllegalStateException("baseUrl is invalid.")
|
||||
|
||||
var urlBuilder = httpUrl.newBuilder()
|
||||
.addPathSegments(requestConfig.path.trimStart('/'))
|
||||
|
||||
requestConfig.query.forEach { query ->
|
||||
query.value.forEach { queryValue ->
|
||||
urlBuilder = urlBuilder.addQueryParameter(query.key, queryValue)
|
||||
}
|
||||
}
|
||||
|
||||
val url = urlBuilder.build()
|
||||
val headers = requestConfig.headers + defaultHeaders
|
||||
|
||||
if(headers[ContentType] ?: "" == "") {
|
||||
throw kotlin.IllegalStateException("Missing Content-Type header. This is required.")
|
||||
}
|
||||
|
||||
if(headers[Accept] ?: "" == "") {
|
||||
throw kotlin.IllegalStateException("Missing Accept header. This is required.")
|
||||
}
|
||||
|
||||
// TODO: support multiple contentType,accept options here.
|
||||
val contentType = (headers[ContentType] as String).substringBefore(";").toLowerCase()
|
||||
val accept = (headers[Accept] as String).substringBefore(";").toLowerCase()
|
||||
|
||||
var request : Request.Builder = when (requestConfig.method) {
|
||||
RequestMethod.DELETE -> Request.Builder().url(url).delete()
|
||||
RequestMethod.GET -> Request.Builder().url(url)
|
||||
RequestMethod.HEAD -> Request.Builder().url(url).head()
|
||||
RequestMethod.PATCH -> Request.Builder().url(url).patch(requestBody(body, contentType))
|
||||
RequestMethod.PUT -> Request.Builder().url(url).put(requestBody(body, contentType))
|
||||
RequestMethod.POST -> Request.Builder().url(url).post(requestBody(body, contentType))
|
||||
RequestMethod.OPTIONS -> Request.Builder().url(url).method("OPTIONS", null)
|
||||
}
|
||||
|
||||
headers.forEach { header -> request = request.addHeader(header.key, header.value) }
|
||||
|
||||
val realRequest = request.build()
|
||||
val response = client.newCall(realRequest).execute()
|
||||
|
||||
// TODO: handle specific mapping types. e.g. Map<int, Class<?>>
|
||||
when {
|
||||
response.isRedirect -> return Redirection(
|
||||
response.code(),
|
||||
response.headers().toMultimap()
|
||||
)
|
||||
response.isInformational -> return Informational(
|
||||
response.message(),
|
||||
response.code(),
|
||||
response.headers().toMultimap()
|
||||
)
|
||||
response.isSuccessful -> return Success(
|
||||
responseBody(response.body(), accept),
|
||||
response.code(),
|
||||
response.headers().toMultimap()
|
||||
)
|
||||
response.isClientError -> return ClientError(
|
||||
response.body()?.string(),
|
||||
response.code(),
|
||||
response.headers().toMultimap()
|
||||
)
|
||||
else -> return ServerError(
|
||||
null,
|
||||
response.body()?.string(),
|
||||
response.code(),
|
||||
response.headers().toMultimap()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
enum class ResponseType {
|
||||
Success, Informational, Redirection, ClientError, ServerError
|
||||
}
|
||||
|
||||
abstract class ApiInfrastructureResponse<T>(val responseType: ResponseType) {
|
||||
abstract val statusCode: Int
|
||||
abstract val headers: Map<String,List<String>>
|
||||
}
|
||||
|
||||
class Success<T>(
|
||||
val data: T,
|
||||
override val statusCode: Int = -1,
|
||||
override val headers: Map<String, List<String>> = mapOf()
|
||||
): ApiInfrastructureResponse<T>(ResponseType.Success)
|
||||
|
||||
class Informational<T>(
|
||||
val statusText: String,
|
||||
override val statusCode: Int = -1,
|
||||
override val headers: Map<String, List<String>> = mapOf()
|
||||
) : ApiInfrastructureResponse<T>(ResponseType.Informational)
|
||||
|
||||
class Redirection<T>(
|
||||
override val statusCode: Int = -1,
|
||||
override val headers: Map<String, List<String>> = mapOf()
|
||||
) : ApiInfrastructureResponse<T>(ResponseType.Redirection)
|
||||
|
||||
class ClientError<T>(
|
||||
val body: Any? = null,
|
||||
override val statusCode: Int = -1,
|
||||
override val headers: Map<String, List<String>> = mapOf()
|
||||
) : ApiInfrastructureResponse<T>(ResponseType.ClientError)
|
||||
|
||||
class ServerError<T>(
|
||||
val message: String? = null,
|
||||
val body: Any? = null,
|
||||
override val statusCode: Int = -1,
|
||||
override val headers: Map<String, List<String>>
|
||||
): ApiInfrastructureResponse<T>(ResponseType.ServerError)
|
@ -0,0 +1,29 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
import kotlin.properties.ReadWriteProperty
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
object ApplicationDelegates {
|
||||
/**
|
||||
* Provides a property delegate, allowing the property to be set once and only once.
|
||||
*
|
||||
* If unset (no default value), a get on the property will throw [IllegalStateException].
|
||||
*/
|
||||
fun <T> setOnce(defaultValue: T? = null) : ReadWriteProperty<Any?, T> = SetOnce(defaultValue)
|
||||
|
||||
private class SetOnce<T>(defaultValue: T? = null) : ReadWriteProperty<Any?, T> {
|
||||
private var isSet = false
|
||||
private var value: T? = defaultValue
|
||||
|
||||
override fun getValue(thisRef: Any?, property: KProperty<*>): T {
|
||||
return value ?: throw IllegalStateException("${property.name} not initialized")
|
||||
}
|
||||
|
||||
override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) = synchronized(this) {
|
||||
if (!isSet) {
|
||||
this.value = value
|
||||
isSet = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
@file:Suppress("unused")
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
import java.lang.RuntimeException
|
||||
|
||||
open class ClientException : RuntimeException {
|
||||
|
||||
/**
|
||||
* Constructs an [ClientException] with no detail message.
|
||||
*/
|
||||
constructor() : super()
|
||||
|
||||
/**
|
||||
* Constructs an [ClientException] with the specified detail message.
|
||||
|
||||
* @param message the detail message.
|
||||
*/
|
||||
constructor(message: kotlin.String) : super(message)
|
||||
|
||||
companion object {
|
||||
private const val serialVersionUID: Long = 123L
|
||||
}
|
||||
}
|
||||
|
||||
open class ServerException : RuntimeException {
|
||||
|
||||
/**
|
||||
* Constructs an [ServerException] with no detail message.
|
||||
*/
|
||||
constructor() : super()
|
||||
|
||||
/**
|
||||
* Constructs an [ServerException] with the specified detail message.
|
||||
|
||||
* @param message the detail message.
|
||||
*/
|
||||
constructor(message: kotlin.String) : super(message)
|
||||
|
||||
companion object {
|
||||
private const val serialVersionUID: Long = 456L
|
||||
}
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
/**
|
||||
* Defines a config object for a given request.
|
||||
* NOTE: This object doesn't include 'body' because it
|
||||
* allows for caching of the constructed object
|
||||
* for many request definitions.
|
||||
* NOTE: Headers is a Map<String,String> because rfc2616 defines
|
||||
* multi-valued headers as csv-only.
|
||||
*/
|
||||
data class RequestConfig(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: Map<String, String> = mapOf(),
|
||||
val query: Map<String, List<String>> = mapOf()
|
||||
)
|
@ -0,0 +1,8 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
/**
|
||||
* Provides enumerated HTTP verbs
|
||||
*/
|
||||
enum class RequestMethod {
|
||||
GET, DELETE, HEAD, OPTIONS, PATCH, POST, PUT
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
import okhttp3.Response
|
||||
|
||||
/**
|
||||
* Provides an extension to evaluation whether the response is a 1xx code
|
||||
*/
|
||||
val Response.isInformational : Boolean get() = this.code() in 100..199
|
||||
|
||||
/**
|
||||
* Provides an extension to evaluation whether the response is a 3xx code
|
||||
*/
|
||||
val Response.isRedirect : Boolean get() = this.code() in 300..399
|
||||
|
||||
/**
|
||||
* Provides an extension to evaluation whether the response is a 4xx code
|
||||
*/
|
||||
val Response.isClientError : Boolean get() = this.code() in 400..499
|
||||
|
||||
/**
|
||||
* Provides an extension to evaluation whether the response is a 5xx (Standard) through 999 (non-standard) code
|
||||
*/
|
||||
val Response.isServerError : Boolean get() = this.code() in 500..999
|
@ -0,0 +1,14 @@
|
||||
package org.openapitools.client.infrastructure
|
||||
|
||||
import com.squareup.moshi.KotlinJsonAdapterFactory
|
||||
import com.squareup.moshi.Moshi
|
||||
import com.squareup.moshi.Rfc3339DateJsonAdapter
|
||||
import java.util.*
|
||||
|
||||
object Serializer {
|
||||
@JvmStatic
|
||||
val moshi: Moshi = Moshi.Builder()
|
||||
.add(KotlinJsonAdapterFactory())
|
||||
.add(Date::class.java, Rfc3339DateJsonAdapter().nullSafe())
|
||||
.build()
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param mapProperty
|
||||
* @param mapOfMapProperty
|
||||
*/
|
||||
data class AdditionalPropertiesClass (
|
||||
val mapProperty: kotlin.collections.Map<kotlin.String, kotlin.String>? = null,
|
||||
val mapOfMapProperty: kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param className
|
||||
* @param color
|
||||
*/
|
||||
data class Animal (
|
||||
val className: kotlin.String,
|
||||
val color: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param code
|
||||
* @param type
|
||||
* @param message
|
||||
*/
|
||||
data class ApiResponse (
|
||||
val code: kotlin.Int? = null,
|
||||
val type: kotlin.String? = null,
|
||||
val message: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param arrayArrayNumber
|
||||
*/
|
||||
data class ArrayOfArrayOfNumberOnly (
|
||||
val arrayArrayNumber: kotlin.Array<kotlin.Array<java.math.BigDecimal>>? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param arrayNumber
|
||||
*/
|
||||
data class ArrayOfNumberOnly (
|
||||
val arrayNumber: kotlin.Array<java.math.BigDecimal>? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
import org.openapitools.client.models.ReadOnlyFirst
|
||||
|
||||
/**
|
||||
*
|
||||
* @param arrayOfString
|
||||
* @param arrayArrayOfInteger
|
||||
* @param arrayArrayOfModel
|
||||
*/
|
||||
data class ArrayTest (
|
||||
val arrayOfString: kotlin.Array<kotlin.String>? = null,
|
||||
val arrayArrayOfInteger: kotlin.Array<kotlin.Array<kotlin.Long>>? = null,
|
||||
val arrayArrayOfModel: kotlin.Array<kotlin.Array<ReadOnlyFirst>>? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param smallCamel
|
||||
* @param capitalCamel
|
||||
* @param smallSnake
|
||||
* @param capitalSnake
|
||||
* @param scAETHFlowPoints
|
||||
* @param ATT_NAME Name of the pet
|
||||
*/
|
||||
data class Capitalization (
|
||||
val smallCamel: kotlin.String? = null,
|
||||
val capitalCamel: kotlin.String? = null,
|
||||
val smallSnake: kotlin.String? = null,
|
||||
val capitalSnake: kotlin.String? = null,
|
||||
val scAETHFlowPoints: kotlin.String? = null,
|
||||
/* Name of the pet */
|
||||
val ATT_NAME: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
import org.openapitools.client.models.Animal
|
||||
|
||||
/**
|
||||
*
|
||||
* @param declawed
|
||||
*/
|
||||
data class Cat (
|
||||
val className: kotlin.String,
|
||||
val declawed: kotlin.Boolean? = null,
|
||||
val color: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param id
|
||||
* @param name
|
||||
*/
|
||||
data class Category (
|
||||
val name: kotlin.String,
|
||||
val id: kotlin.Long? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
* Model for testing model with \"_class\" property
|
||||
* @param propertyClass
|
||||
*/
|
||||
data class ClassModel (
|
||||
val propertyClass: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param client
|
||||
*/
|
||||
data class Client (
|
||||
val client: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,27 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
import org.openapitools.client.models.Animal
|
||||
|
||||
/**
|
||||
*
|
||||
* @param breed
|
||||
*/
|
||||
data class Dog (
|
||||
val className: kotlin.String,
|
||||
val breed: kotlin.String? = null,
|
||||
val color: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,51 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
/**
|
||||
*
|
||||
* @param justSymbol
|
||||
* @param arrayEnum
|
||||
*/
|
||||
data class EnumArrays (
|
||||
val justSymbol: EnumArrays.JustSymbol? = null,
|
||||
val arrayEnum: EnumArrays.ArrayEnum? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: greaterThanEqual,dollar
|
||||
*/
|
||||
enum class JustSymbol(val value: kotlin.String){
|
||||
|
||||
@Json(name = ">=") greaterThanEqual(">="),
|
||||
|
||||
@Json(name = "$") dollar("$");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: fish,crab
|
||||
*/
|
||||
enum class ArrayEnum(val value: kotlin.Array<kotlin.String>){
|
||||
|
||||
@Json(name = "fish") fish("fish"),
|
||||
|
||||
@Json(name = "crab") crab("crab");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: abc,minusefg,leftParenthesisxyzRightParenthesis
|
||||
*/
|
||||
enum class EnumClass(val value: kotlin.String){
|
||||
|
||||
@Json(name = "_abc") abc("_abc"),
|
||||
|
||||
@Json(name = "-efg") minusefg("-efg"),
|
||||
|
||||
@Json(name = "(xyz)") leftParenthesisxyzRightParenthesis("(xyz)");
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,86 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
import org.openapitools.client.models.OuterEnum
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
/**
|
||||
*
|
||||
* @param enumString
|
||||
* @param enumStringRequired
|
||||
* @param enumInteger
|
||||
* @param enumNumber
|
||||
* @param outerEnum
|
||||
*/
|
||||
data class EnumTest (
|
||||
val enumStringRequired: EnumTest.EnumStringRequired,
|
||||
val enumString: EnumTest.EnumString? = null,
|
||||
val enumInteger: EnumTest.EnumInteger? = null,
|
||||
val enumNumber: EnumTest.EnumNumber? = null,
|
||||
val outerEnum: OuterEnum? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: uPPER,lower,eMPTY
|
||||
*/
|
||||
enum class EnumString(val value: kotlin.String){
|
||||
|
||||
@Json(name = "UPPER") uPPER("UPPER"),
|
||||
|
||||
@Json(name = "lower") lower("lower"),
|
||||
|
||||
@Json(name = "") eMPTY("");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: uPPER,lower,eMPTY
|
||||
*/
|
||||
enum class EnumStringRequired(val value: kotlin.String){
|
||||
|
||||
@Json(name = "UPPER") uPPER("UPPER"),
|
||||
|
||||
@Json(name = "lower") lower("lower"),
|
||||
|
||||
@Json(name = "") eMPTY("");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: _1,minus1
|
||||
*/
|
||||
enum class EnumInteger(val value: kotlin.Int){
|
||||
|
||||
@Json(name = 1) _1(1),
|
||||
|
||||
@Json(name = -1) minus1(-1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: _1period1,minus1Period2
|
||||
*/
|
||||
enum class EnumNumber(val value: kotlin.Double){
|
||||
|
||||
@Json(name = 1.1) _1period1(1.1),
|
||||
|
||||
@Json(name = -1.2) minus1Period2(-1.2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param file
|
||||
* @param files
|
||||
*/
|
||||
data class FileSchemaTestClass (
|
||||
val file: java.io.File? = null,
|
||||
val files: kotlin.Array<java.io.File>? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param bar
|
||||
*/
|
||||
data class Foo (
|
||||
val bar: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param integer
|
||||
* @param int32
|
||||
* @param int64
|
||||
* @param number
|
||||
* @param float
|
||||
* @param double
|
||||
* @param string
|
||||
* @param byte
|
||||
* @param binary
|
||||
* @param date
|
||||
* @param dateTime
|
||||
* @param uuid
|
||||
* @param password
|
||||
* @param patternWithDigits A string that is a 10 digit number. Can have leading zeros.
|
||||
* @param patternWithDigitsAndDelimiter A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.
|
||||
*/
|
||||
data class FormatTest (
|
||||
val number: java.math.BigDecimal,
|
||||
val byte: kotlin.ByteArray,
|
||||
val date: java.time.LocalDateTime,
|
||||
val password: kotlin.String,
|
||||
val integer: kotlin.Int? = null,
|
||||
val int32: kotlin.Int? = null,
|
||||
val int64: kotlin.Long? = null,
|
||||
val float: kotlin.Float? = null,
|
||||
val double: kotlin.Double? = null,
|
||||
val string: kotlin.String? = null,
|
||||
val binary: java.io.File? = null,
|
||||
val dateTime: java.time.LocalDateTime? = null,
|
||||
val uuid: java.util.UUID? = null,
|
||||
/* A string that is a 10 digit number. Can have leading zeros. */
|
||||
val patternWithDigits: kotlin.String? = null,
|
||||
/* A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. */
|
||||
val patternWithDigitsAndDelimiter: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param bar
|
||||
* @param foo
|
||||
*/
|
||||
data class HasOnlyReadOnly (
|
||||
val bar: kotlin.String? = null,
|
||||
val foo: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
data class InlineObject (
|
||||
/* Updated name of the pet */
|
||||
val name: kotlin.String? = null,
|
||||
/* Updated status of the pet */
|
||||
val status: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
*/
|
||||
data class InlineObject1 (
|
||||
/* Additional data to pass to server */
|
||||
val additionalMetadata: kotlin.String? = null,
|
||||
/* file to upload */
|
||||
val file: java.io.File? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
/**
|
||||
*
|
||||
* @param enumFormStringArray Form parameter enum test (string array)
|
||||
* @param enumFormString Form parameter enum test (string)
|
||||
*/
|
||||
data class InlineObject2 (
|
||||
/* Form parameter enum test (string array) */
|
||||
val enumFormStringArray: InlineObject2.EnumFormStringArray? = null,
|
||||
/* Form parameter enum test (string) */
|
||||
val enumFormString: InlineObject2.EnumFormString? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
* Form parameter enum test (string array)
|
||||
* Values: greaterThan,dollar
|
||||
*/
|
||||
enum class EnumFormStringArray(val value: kotlin.Array<kotlin.String>){
|
||||
|
||||
@Json(name = ">") greaterThan(">"),
|
||||
|
||||
@Json(name = "$") dollar("$");
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Form parameter enum test (string)
|
||||
* Values: abc,minusefg,leftParenthesisxyzRightParenthesis
|
||||
*/
|
||||
enum class EnumFormString(val value: kotlin.String){
|
||||
|
||||
@Json(name = "_abc") abc("_abc"),
|
||||
|
||||
@Json(name = "-efg") minusefg("-efg"),
|
||||
|
||||
@Json(name = "(xyz)") leftParenthesisxyzRightParenthesis("(xyz)");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,64 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param integer None
|
||||
* @param int32 None
|
||||
* @param int64 None
|
||||
* @param number None
|
||||
* @param float None
|
||||
* @param double None
|
||||
* @param string None
|
||||
* @param patternWithoutDelimiter None
|
||||
* @param byte None
|
||||
* @param binary None
|
||||
* @param date None
|
||||
* @param dateTime None
|
||||
* @param password None
|
||||
* @param callback None
|
||||
*/
|
||||
data class InlineObject3 (
|
||||
/* None */
|
||||
val number: java.math.BigDecimal,
|
||||
/* None */
|
||||
val double: kotlin.Double,
|
||||
/* None */
|
||||
val patternWithoutDelimiter: kotlin.String,
|
||||
/* None */
|
||||
val byte: kotlin.ByteArray,
|
||||
/* None */
|
||||
val integer: kotlin.Int? = null,
|
||||
/* None */
|
||||
val int32: kotlin.Int? = null,
|
||||
/* None */
|
||||
val int64: kotlin.Long? = null,
|
||||
/* None */
|
||||
val float: kotlin.Float? = null,
|
||||
/* None */
|
||||
val string: kotlin.String? = null,
|
||||
/* None */
|
||||
val binary: java.io.File? = null,
|
||||
/* None */
|
||||
val date: java.time.LocalDateTime? = null,
|
||||
/* None */
|
||||
val dateTime: java.time.LocalDateTime? = null,
|
||||
/* None */
|
||||
val password: kotlin.String? = null,
|
||||
/* None */
|
||||
val callback: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param param field1
|
||||
* @param param2 field2
|
||||
*/
|
||||
data class InlineObject4 (
|
||||
/* field1 */
|
||||
val param: kotlin.String,
|
||||
/* field2 */
|
||||
val param2: kotlin.String
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param requiredFile file to upload
|
||||
*/
|
||||
data class InlineObject5 (
|
||||
/* file to upload */
|
||||
val requiredFile: java.io.File,
|
||||
/* Additional data to pass to server */
|
||||
val additionalMetadata: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
import org.openapitools.client.models.Foo
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string
|
||||
*/
|
||||
data class InlineResponseDefault (
|
||||
val string: Foo? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,24 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @param `123list`
|
||||
*/
|
||||
data class List (
|
||||
val `123list`: kotlin.String? = null
|
||||
) {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
/**
|
||||
* OpenAPI Petstore
|
||||
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
|
||||
*
|
||||
* OpenAPI spec version: 1.0.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
package org.openapitools.client.models
|
||||
|
||||
|
||||
import com.squareup.moshi.Json
|
||||
/**
|
||||
*
|
||||
* @param mapMapOfString
|
||||
* @param mapOfEnumString
|
||||
* @param directMap
|
||||
* @param indirectMap
|
||||
*/
|
||||
data class MapTest (
|
||||
val mapMapOfString: kotlin.collections.Map<kotlin.String, kotlin.collections.Map<kotlin.String, kotlin.String>>? = null,
|
||||
val mapOfEnumString: MapTest.MapOfEnumString? = null,
|
||||
val directMap: kotlin.collections.Map<kotlin.String, kotlin.Boolean>? = null,
|
||||
val indirectMap: kotlin.collections.Map<kotlin.String, kotlin.Boolean>? = null
|
||||
) {
|
||||
|
||||
/**
|
||||
*
|
||||
* Values: uPPER,lower
|
||||
*/
|
||||
enum class MapOfEnumString(val value: kotlin.collections.Map<kotlin.String, kotlin.String>){
|
||||
|
||||
@Json(name = "UPPER") uPPER("UPPER"),
|
||||
|
||||
@Json(name = "lower") lower("lower");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user