Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • O openapi-generator
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 3,476
    • Issues 3,476
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 402
    • Merge requests 402
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenAPI Tools
  • openapi-generator
  • Issues
  • #2462
Closed
Open
Issue created Mar 20, 2019 by William Cheng@wing328Contributor0 of 6 checklist items completed0/6 checklist items

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

Assignee
Assign to
Time tracking