Skip to content

Commit e600f7d

Browse files
authored
[kotlin][client] silence deprecation warning (#9656)
* [kotlin][client] silence deprecated warning when used internally * [kotlin][client] update sample projects
1 parent c379f5b commit e600f7d

File tree

12 files changed

+14
-0
lines changed
  • modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp
  • samples/client/petstore
    • kotlin/src/main/kotlin/org/openapitools/client/apis
    • kotlin-gson/src/main/kotlin/org/openapitools/client/apis
    • kotlin-jackson/src/main/kotlin/org/openapitools/client/apis
    • kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis
    • kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis
    • kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis
    • kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis
    • kotlin-nullable/src/main/kotlin/org/openapitools/client/apis
    • kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis
    • kotlin-string/src/main/kotlin/org/openapitools/client/apis
    • kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis

12 files changed

+14
-0
lines changed

modules/openapi-generator/src/main/resources/kotlin-client/libraries/jvm-okhttp/api.mustache

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ import {{packageName}}.infrastructure.toMultiValue
4141
@Deprecated(message = "This operation is deprecated.")
4242
{{/isDeprecated}}
4343
{{^doNotUseRxAndCoroutines}}{{#useCoroutines}}suspend {{/useCoroutines}}{{/doNotUseRxAndCoroutines}}fun {{operationId}}({{#allParams}}{{{paramName}}}: {{{dataType}}}{{^required}}?{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) : {{#returnType}}{{{returnType}}}{{#nullableReturnType}}?{{/nullableReturnType}}{{/returnType}}{{^returnType}}Unit{{/returnType}} {
44+
{{#isDeprecated}}
45+
@Suppress("DEPRECATION")
46+
{{/isDeprecated}}
4447
val localVariableConfig = {{operationId}}RequestConfig({{#allParams}}{{{paramName}}} = {{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}})
4548

4649
val localVarResponse = request<{{#hasBodyParam}}{{#bodyParams}}{{{dataType}}}{{/bodyParams}}{{/hasBodyParam}}{{^hasBodyParam}}{{^hasFormParams}}Unit{{/hasFormParams}}{{#hasFormParams}}Map<String, Any?>{{/hasFormParams}}{{/hasBodyParam}}, {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Unit{{/returnType}}>(

samples/client/petstore/kotlin-gson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-jackson/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-json-request-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
154154
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
155155
@Deprecated(message = "This operation is deprecated.")
156156
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
157+
@Suppress("DEPRECATION")
157158
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
158159

159160
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-jvm-okhttp4-coroutines/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
suspend fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-moshi-codegen/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-nonpublic/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ internal class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(bas
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-nullable/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet>? {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-okhttp3/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-string/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin-threetenbp/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt

+1
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath) : ApiClient(basePath) {
210210
@Throws(UnsupportedOperationException::class, ClientException::class, ServerException::class)
211211
@Deprecated(message = "This operation is deprecated.")
212212
fun findPetsByTags(tags: kotlin.collections.List<kotlin.String>) : kotlin.collections.List<Pet> {
213+
@Suppress("DEPRECATION")
213214
val localVariableConfig = findPetsByTagsRequestConfig(tags = tags)
214215

215216
val localVarResponse = request<Unit, kotlin.collections.List<Pet>>(

0 commit comments

Comments
 (0)