Merge remote-tracking branch 'origin' into 7.0.x

This commit is contained in:
William Cheng
2023-03-03 21:52:50 +08:00
10595 changed files with 418520 additions and 73194 deletions

View File

@@ -71,13 +71,6 @@ Class | Method | HTTP request | Description
<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="petstore_auth"></a>
### petstore_auth
@@ -88,3 +81,10 @@ Class | Method | HTTP request | Description
- write:pets: modify pets in your account
- read:pets: read your pets
<a name="api_key"></a>
### api_key
- **Type**: API key
- **API key parameter name**: api_key
- **Location**: HTTP header

View File

@@ -1,17 +1,17 @@
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
plugins {
kotlin("multiplatform") version "1.6.0" // kotlin_version
kotlin("plugin.serialization") version "1.6.0" // kotlin_version
kotlin("multiplatform") version "1.7.21" // kotlin_version
kotlin("plugin.serialization") version "1.7.21" // kotlin_version
}
group = "org.openapitools"
version = "1.0.0"
val kotlin_version = "1.6.10"
val coroutines_version = "1.6.3"
val kotlin_version = "1.7.21"
val coroutines_version = "1.6.4"
val serialization_version = "1.3.3"
val ktor_version = "2.0.3"
val ktor_version = "2.1.3"
repositories {
mavenCentral()
@@ -76,7 +76,7 @@ kotlin {
all {
languageSettings.apply {
useExperimentalAnnotation("kotlin.Experimental")
optIn("kotlin.Experimental")
}
}
}

View File

@@ -108,7 +108,7 @@ Configure api_key:
Find purchase order by ID
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
### Example
```kotlin

View File

@@ -54,7 +54,8 @@ open class PetApi(
RequestMethod.POST,
"/pet",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return jsonRequest(
@@ -88,7 +89,8 @@ open class PetApi(
RequestMethod.DELETE,
"/pet/{petId}".replace("{" + "petId" + "}", "$petId"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return request(
@@ -121,7 +123,8 @@ open class PetApi(
RequestMethod.GET,
"/pet/findByStatus",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return request(
@@ -164,7 +167,8 @@ open class PetApi(
RequestMethod.GET,
"/pet/findByTags",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return request(
@@ -206,7 +210,8 @@ open class PetApi(
RequestMethod.GET,
"/pet/{petId}".replace("{" + "petId" + "}", "$petId"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return request(
@@ -236,7 +241,8 @@ open class PetApi(
RequestMethod.PUT,
"/pet",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return jsonRequest(
@@ -273,7 +279,8 @@ open class PetApi(
RequestMethod.POST,
"/pet/{petId}".replace("{" + "petId" + "}", "$petId"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return urlEncodedFormRequest(
@@ -310,7 +317,8 @@ open class PetApi(
RequestMethod.POST,
"/pet/{petId}/uploadImage".replace("{" + "petId" + "}", "$petId"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return multipartFormRequest(

View File

@@ -54,7 +54,8 @@ open class StoreApi(
RequestMethod.DELETE,
"/store/order/{orderId}".replace("{" + "orderId" + "}", "$orderId"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return request(
@@ -85,7 +86,8 @@ open class StoreApi(
RequestMethod.GET,
"/store/inventory",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = true,
)
return request(
@@ -108,7 +110,7 @@ open class StoreApi(
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generate exceptions
* @param orderId ID of pet that needs to be fetched
* @return Order
*/
@@ -127,7 +129,8 @@ open class StoreApi(
RequestMethod.GET,
"/store/order/{orderId}".replace("{" + "orderId" + "}", "$orderId"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return request(
@@ -158,7 +161,8 @@ open class StoreApi(
RequestMethod.POST,
"/store/order",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return jsonRequest(

View File

@@ -53,7 +53,8 @@ open class UserApi(
RequestMethod.POST,
"/user",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return jsonRequest(
@@ -84,7 +85,8 @@ open class UserApi(
RequestMethod.POST,
"/user/createWithArray",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return jsonRequest(
@@ -124,7 +126,8 @@ open class UserApi(
RequestMethod.POST,
"/user/createWithList",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return jsonRequest(
@@ -165,7 +168,8 @@ open class UserApi(
RequestMethod.DELETE,
"/user/{username}".replace("{" + "username" + "}", "$username"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return request(
@@ -197,7 +201,8 @@ open class UserApi(
RequestMethod.GET,
"/user/{username}".replace("{" + "username" + "}", "$username"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return request(
@@ -232,7 +237,8 @@ open class UserApi(
RequestMethod.GET,
"/user/login",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return request(
@@ -262,7 +268,8 @@ open class UserApi(
RequestMethod.GET,
"/user/logout",
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return request(
@@ -293,7 +300,8 @@ open class UserApi(
RequestMethod.PUT,
"/user/{username}".replace("{" + "username" + "}", "$username"),
query = localVariableQuery,
headers = localVariableHeaders
headers = localVariableHeaders,
requiresAuthentication = false,
)
return jsonRequest(

View File

@@ -38,8 +38,8 @@ open class ApiClient(
private val authentications: kotlin.collections.Map<String, Authentication> by lazy {
mapOf(
"api_key" to ApiKeyAuth("header", "api_key"),
"petstore_auth" to OAuth())
"petstore_auth" to OAuth(),
"api_key" to ApiKeyAuth("header", "api_key"))
}
companion object {

View File

@@ -13,5 +13,6 @@ data class RequestConfig<T>(
val path: String,
val headers: MutableMap<String, String> = mutableMapOf(),
val query: MutableMap<String, List<String>> = mutableMapOf(),
val requiresAuthentication: Boolean,
val body: T? = null
)