forked from loafle/openapi-generator-original
[kotlin-client][jvm-spring-*] Fixed URL encoding (#17493)
* [kotlin-client][jvm-spring-*] do URL encoding via the UrlBuilder instead of manual replacement * [kotlin-client][jvm-spring-*] Fixed imports * ensure up-to-date * Fixed syntax problem * Removed unnecessary toString()
This commit is contained in:
parent
cfe7dcc0cf
commit
d0e533d573
@ -12,6 +12,7 @@ package {{packageName}}.infrastructure
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -14,6 +14,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
|
||||
|
||||
{{#imports}}import {{import}}
|
||||
{{/imports}}
|
||||
import {{packageName}}.infrastructure.*
|
||||
@ -122,9 +123,16 @@ import {{packageName}}.infrastructure.*
|
||||
{{/consumes}}{{/hasConsumes}}{{/hasFormParams}}{{#hasProduces}}localVariableHeaders["Accept"] = "{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}"
|
||||
{{/hasProduces}}
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
{{#pathParams}}
|
||||
"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}{{/isContainer}},
|
||||
{{/pathParams}}
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.{{httpMethod}},
|
||||
path = "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}},
|
||||
path = "{{path}}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = {{#hasAuthMethods}}true{{/hasAuthMethods}}{{^hasAuthMethods}}false{{/hasAuthMethods}},
|
||||
|
@ -4,9 +4,9 @@ import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.http.HttpHeaders
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.web.util.UriUtils
|
||||
import org.springframework.web.client.RestClient
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
open class ApiClient(protected val client: RestClient) {
|
||||
|
||||
@ -32,19 +32,15 @@ open class ApiClient(protected val client: RestClient) {
|
||||
}
|
||||
}
|
||||
|
||||
protected fun encodeURIComponent(uriComponent: kotlin.String) =
|
||||
UriUtils.encodeFragment(uriComponent, Charsets.UTF_8)
|
||||
|
||||
private fun <I> RestClient.method(requestConfig: RequestConfig<I>)=
|
||||
method(HttpMethod.valueOf(requestConfig.method.name))
|
||||
|
||||
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
|
||||
uri { builder ->
|
||||
builder.path(requestConfig.path).apply {
|
||||
requestConfig.query.forEach { (name, value) ->
|
||||
queryParam(name, value)
|
||||
}
|
||||
}.build()
|
||||
builder
|
||||
.path(requestConfig.path)
|
||||
.queryParams(LinkedMultiValueMap(requestConfig.query))
|
||||
.build(requestConfig.params)
|
||||
}
|
||||
|
||||
private fun <I> RestClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
|
||||
|
@ -14,6 +14,7 @@ import org.springframework.http.codec.json.Jackson2JsonEncoder
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
import reactor.core.publisher.Mono
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
{{#imports}}import {{import}}
|
||||
{{/imports}}
|
||||
@ -126,9 +127,16 @@ import {{packageName}}.infrastructure.*
|
||||
{{/consumes}}{{/hasConsumes}}{{/hasFormParams}}{{#hasProduces}}localVariableHeaders["Accept"] = "{{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}"
|
||||
{{/hasProduces}}
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
{{#pathParams}}
|
||||
"{{baseName}}" to {{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}{{/isContainer}},
|
||||
{{/pathParams}}
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.{{httpMethod}},
|
||||
path = "{{path}}"{{#pathParams}}.replace("{"+"{{baseName}}"+"}", encodeURIComponent({{#isContainer}}{{paramName}}.joinToString(","){{/isContainer}}{{^isContainer}}{{{paramName}}}{{#isEnum}}.value{{/isEnum}}.toString(){{/isContainer}})){{/pathParams}},
|
||||
path = "{{path}}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = {{#hasAuthMethods}}true{{/hasAuthMethods}}{{^hasAuthMethods}}false{{/hasAuthMethods}},
|
||||
|
@ -4,9 +4,9 @@ import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.http.HttpHeaders
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.web.util.UriUtils
|
||||
import org.springframework.web.reactive.function.client.WebClient
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
open class ApiClient(protected val client: WebClient) {
|
||||
@ -33,19 +33,15 @@ open class ApiClient(protected val client: WebClient) {
|
||||
}
|
||||
}
|
||||
|
||||
protected fun encodeURIComponent(uriComponent: kotlin.String) =
|
||||
UriUtils.encodeFragment(uriComponent, Charsets.UTF_8)
|
||||
|
||||
private fun <I> WebClient.method(requestConfig: RequestConfig<I>)=
|
||||
method(HttpMethod.valueOf(requestConfig.method.name))
|
||||
|
||||
private fun <I> WebClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
|
||||
uri { builder ->
|
||||
builder.path(requestConfig.path).apply {
|
||||
requestConfig.query.forEach { (name, value) ->
|
||||
queryParam(name, value)
|
||||
}
|
||||
}.build()
|
||||
builder
|
||||
.path(requestConfig.path)
|
||||
.queryParams(LinkedMultiValueMap(requestConfig.query))
|
||||
.build(requestConfig.params)
|
||||
}
|
||||
|
||||
private fun <I> WebClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.codec.json.Jackson2JsonEncoder
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
import reactor.core.publisher.Mono
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
import org.openapitools.client.models.ModelApiResponse
|
||||
import org.openapitools.client.models.Pet
|
||||
@ -63,9 +64,13 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/xml"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -94,9 +99,14 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
apiKey?.apply { localVariableHeaders["api_key"] = this.toString() }
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -137,9 +147,13 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/findByStatus",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -174,9 +188,13 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/findByTags",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -205,9 +223,14 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -238,9 +261,13 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/xml"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.PUT,
|
||||
path = "/pet",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -270,9 +297,14 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded")
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -303,9 +335,14 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("Content-Type" to "multipart/form-data")
|
||||
localVariableHeaders["Accept"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}/uploadImage",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.codec.json.Jackson2JsonEncoder
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
import reactor.core.publisher.Mono
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
import org.openapitools.client.models.Order
|
||||
import org.openapitools.client.infrastructure.*
|
||||
@ -59,9 +60,14 @@ class StoreApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"orderId" to orderId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())),
|
||||
path = "/store/order/{orderId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -90,9 +96,13 @@ class StoreApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/store/inventory",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -121,9 +131,14 @@ class StoreApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"orderId" to orderId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())),
|
||||
path = "/store/order/{orderId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -153,9 +168,13 @@ class StoreApi(client: WebClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/store/order",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.codec.json.Jackson2JsonEncoder
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
import reactor.core.publisher.Mono
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
import org.openapitools.client.models.User
|
||||
import org.openapitools.client.infrastructure.*
|
||||
@ -60,9 +61,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -91,9 +96,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user/createWithArray",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -122,9 +131,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user/createWithList",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -152,9 +165,14 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -183,9 +201,14 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -218,9 +241,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/login",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -248,9 +275,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/logout",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -279,9 +310,14 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.PUT,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
|
@ -4,9 +4,9 @@ import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.http.HttpHeaders
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.web.util.UriUtils
|
||||
import org.springframework.web.reactive.function.client.WebClient
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
open class ApiClient(protected val client: WebClient) {
|
||||
@ -33,19 +33,15 @@ open class ApiClient(protected val client: WebClient) {
|
||||
}
|
||||
}
|
||||
|
||||
protected fun encodeURIComponent(uriComponent: kotlin.String) =
|
||||
UriUtils.encodeFragment(uriComponent, Charsets.UTF_8)
|
||||
|
||||
private fun <I> WebClient.method(requestConfig: RequestConfig<I>)=
|
||||
method(HttpMethod.valueOf(requestConfig.method.name))
|
||||
|
||||
private fun <I> WebClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
|
||||
uri { builder ->
|
||||
builder.path(requestConfig.path).apply {
|
||||
requestConfig.query.forEach { (name, value) ->
|
||||
queryParam(name, value)
|
||||
}
|
||||
}.build()
|
||||
builder
|
||||
.path(requestConfig.path)
|
||||
.queryParams(LinkedMultiValueMap(requestConfig.query))
|
||||
.build(requestConfig.params)
|
||||
}
|
||||
|
||||
private fun <I> WebClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
|
||||
|
||||
import org.openapitools.client.models.ModelApiResponse
|
||||
import org.openapitools.client.models.Pet
|
||||
import org.openapitools.client.infrastructure.*
|
||||
@ -59,9 +60,13 @@ class PetApi(client: RestClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/xml"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -90,9 +95,14 @@ class PetApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
apiKey?.apply { localVariableHeaders["api_key"] = this.toString() }
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -133,9 +143,13 @@ class PetApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/findByStatus",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -170,9 +184,13 @@ class PetApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/findByTags",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -201,9 +219,14 @@ class PetApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -234,9 +257,13 @@ class PetApi(client: RestClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/xml"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.PUT,
|
||||
path = "/pet",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -266,9 +293,14 @@ class PetApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded")
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -299,9 +331,14 @@ class PetApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("Content-Type" to "multipart/form-data")
|
||||
localVariableHeaders["Accept"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}/uploadImage",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
|
||||
|
||||
import org.openapitools.client.models.Order
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
@ -55,9 +56,14 @@ class StoreApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"orderId" to orderId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())),
|
||||
path = "/store/order/{orderId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -86,9 +92,13 @@ class StoreApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/store/inventory",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -117,9 +127,14 @@ class StoreApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"orderId" to orderId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())),
|
||||
path = "/store/order/{orderId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -149,9 +164,13 @@ class StoreApi(client: RestClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/store/order",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.converter.json.MappingJackson2HttpMessageConvert
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
|
||||
|
||||
import org.openapitools.client.models.User
|
||||
import org.openapitools.client.infrastructure.*
|
||||
|
||||
@ -56,9 +57,13 @@ class UserApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -87,9 +92,13 @@ class UserApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user/createWithArray",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -118,9 +127,13 @@ class UserApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user/createWithList",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -148,9 +161,14 @@ class UserApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -179,9 +197,14 @@ class UserApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -214,9 +237,13 @@ class UserApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/login",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -244,9 +271,13 @@ class UserApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/logout",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -275,9 +306,14 @@ class UserApi(client: RestClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.PUT,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
|
@ -4,9 +4,9 @@ import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.http.HttpHeaders
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.web.util.UriUtils
|
||||
import org.springframework.web.client.RestClient
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
open class ApiClient(protected val client: RestClient) {
|
||||
|
||||
@ -32,19 +32,15 @@ open class ApiClient(protected val client: RestClient) {
|
||||
}
|
||||
}
|
||||
|
||||
protected fun encodeURIComponent(uriComponent: kotlin.String) =
|
||||
UriUtils.encodeFragment(uriComponent, Charsets.UTF_8)
|
||||
|
||||
private fun <I> RestClient.method(requestConfig: RequestConfig<I>)=
|
||||
method(HttpMethod.valueOf(requestConfig.method.name))
|
||||
|
||||
private fun <I> RestClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
|
||||
uri { builder ->
|
||||
builder.path(requestConfig.path).apply {
|
||||
requestConfig.query.forEach { (name, value) ->
|
||||
queryParam(name, value)
|
||||
}
|
||||
}.build()
|
||||
builder
|
||||
.path(requestConfig.path)
|
||||
.queryParams(LinkedMultiValueMap(requestConfig.query))
|
||||
.build(requestConfig.params)
|
||||
}
|
||||
|
||||
private fun <I> RestClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.codec.json.Jackson2JsonEncoder
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
import reactor.core.publisher.Mono
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
import org.openapitools.client.models.ModelApiResponse
|
||||
import org.openapitools.client.models.Pet
|
||||
@ -63,9 +64,13 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/xml"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -94,9 +99,14 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
apiKey?.apply { localVariableHeaders["api_key"] = this.toString() }
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -137,9 +147,13 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/findByStatus",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -174,9 +188,13 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/findByTags",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -205,9 +223,14 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -238,9 +261,13 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/xml"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.PUT,
|
||||
path = "/pet",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -270,9 +297,14 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("Content-Type" to "application/x-www-form-urlencoded")
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet/{petId}".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -303,9 +335,14 @@ class PetApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf("Content-Type" to "multipart/form-data")
|
||||
localVariableHeaders["Accept"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"petId" to petId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", encodeURIComponent(petId.toString())),
|
||||
path = "/pet/{petId}/uploadImage",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.codec.json.Jackson2JsonEncoder
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
import reactor.core.publisher.Mono
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
import org.openapitools.client.models.Order
|
||||
import org.openapitools.client.infrastructure.*
|
||||
@ -59,9 +60,14 @@ class StoreApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"orderId" to orderId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())),
|
||||
path = "/store/order/{orderId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -90,9 +96,13 @@ class StoreApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/store/inventory",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -121,9 +131,14 @@ class StoreApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"orderId" to orderId,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", encodeURIComponent(orderId.toString())),
|
||||
path = "/store/order/{orderId}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -153,9 +168,13 @@ class StoreApi(client: WebClient) : ApiClient(client) {
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/store/order",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
|
@ -24,6 +24,7 @@ import org.springframework.http.codec.json.Jackson2JsonEncoder
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.http.MediaType
|
||||
import reactor.core.publisher.Mono
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
|
||||
import org.openapitools.client.models.User
|
||||
import org.openapitools.client.infrastructure.*
|
||||
@ -60,9 +61,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -91,9 +96,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user/createWithArray",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -122,9 +131,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.POST,
|
||||
path = "/user/createWithList",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -152,9 +165,14 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.DELETE,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -183,9 +201,14 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -218,9 +241,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Accept"] = "application/xml, application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/login",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = false,
|
||||
@ -248,9 +275,13 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableQuery = mutableMapOf<kotlin.String, kotlin.collections.List<kotlin.String>>()
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.GET,
|
||||
path = "/user/logout",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
@ -279,9 +310,14 @@ class UserApi(client: WebClient) : ApiClient(client) {
|
||||
val localVariableHeaders: MutableMap<String, String> = mutableMapOf()
|
||||
localVariableHeaders["Content-Type"] = "application/json"
|
||||
|
||||
val params = mutableMapOf<String, Any>(
|
||||
"username" to username,
|
||||
)
|
||||
|
||||
return RequestConfig(
|
||||
method = RequestMethod.PUT,
|
||||
path = "/user/{username}".replace("{"+"username"+"}", encodeURIComponent(username.toString())),
|
||||
path = "/user/{username}",
|
||||
params = params,
|
||||
query = localVariableQuery,
|
||||
headers = localVariableHeaders,
|
||||
requiresAuthentication = true,
|
||||
|
@ -4,9 +4,9 @@ import org.springframework.core.ParameterizedTypeReference
|
||||
import org.springframework.http.HttpHeaders
|
||||
import org.springframework.http.HttpMethod
|
||||
import org.springframework.http.MediaType
|
||||
import org.springframework.web.util.UriUtils
|
||||
import org.springframework.web.reactive.function.client.WebClient
|
||||
import org.springframework.http.ResponseEntity
|
||||
import org.springframework.util.LinkedMultiValueMap
|
||||
import reactor.core.publisher.Mono
|
||||
|
||||
open class ApiClient(protected val client: WebClient) {
|
||||
@ -33,19 +33,15 @@ open class ApiClient(protected val client: WebClient) {
|
||||
}
|
||||
}
|
||||
|
||||
protected fun encodeURIComponent(uriComponent: kotlin.String) =
|
||||
UriUtils.encodeFragment(uriComponent, Charsets.UTF_8)
|
||||
|
||||
private fun <I> WebClient.method(requestConfig: RequestConfig<I>)=
|
||||
method(HttpMethod.valueOf(requestConfig.method.name))
|
||||
|
||||
private fun <I> WebClient.RequestBodyUriSpec.uri(requestConfig: RequestConfig<I>) =
|
||||
uri { builder ->
|
||||
builder.path(requestConfig.path).apply {
|
||||
requestConfig.query.forEach { (name, value) ->
|
||||
queryParam(name, value)
|
||||
}
|
||||
}.build()
|
||||
builder
|
||||
.path(requestConfig.path)
|
||||
.queryParams(LinkedMultiValueMap(requestConfig.query))
|
||||
.build(requestConfig.params)
|
||||
}
|
||||
|
||||
private fun <I> WebClient.RequestBodySpec.headers(requestConfig: RequestConfig<I>) =
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ internal data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
@ -12,6 +12,7 @@ data class RequestConfig<T>(
|
||||
val method: RequestMethod,
|
||||
val path: String,
|
||||
val headers: MutableMap<String, String> = mutableMapOf(),
|
||||
val params: MutableMap<String, Any> = mutableMapOf(),
|
||||
val query: MutableMap<String, List<String>> = mutableMapOf(),
|
||||
val requiresAuthentication: Boolean,
|
||||
val body: T? = null
|
||||
|
Loading…
x
Reference in New Issue
Block a user