Kotlin client warnings
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
When running gradle test
with the Kotline petstore client, I got the following warning:
> Task :compileKotlin
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt: (48, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt: (80, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt: (112, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt: (144, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt: (176, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt: (207, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt: (240, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/PetApi.kt: (274, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt: (47, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt: (78, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt: (110, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/StoreApi.kt: (142, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt: (47, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt: (78, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt: (109, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt: (140, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt: (172, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt: (205, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt: (235, 13): 'when' is exhaustive so 'else' is redundant here
w: /Users/williamcheng/Code/openapi-generator/samples/client/petstore/kotlin/src/main/kotlin/org/openapitools/client/apis/UserApi.kt: (267, 13): 'when' is exhaustive so 'else' is redundant here
openapi-generator version
Latest master
Command line used for generation
cd samples/client/petstore/kotlin && gradle test
Steps to reproduce
Related issues/PRs
Suggest a fix
If anyone has time to contribute a PR to address these warnings, please let us know.
Kotlin client mustache templates: https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/api.mustache