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
  • #3529
Closed
Open
Issue created Aug 01, 2019 by Administrator@rootContributor

[REQ] [KOTLIN] Don't use TODO() function provided by Kotlin

Created by: toXel

The use of the Kotlin function TODO() can IMO be dangerous sometimes. For example here: https://github.com/OpenAPITools/openapi-generator/blob/4d285939a662312b99b238dc5385fea548253ba2/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache#L60-L63

When mediaType is not application/json the app or program, in which the client is used, just crashes. AFAIK there is no way to catch these exceptions without modifying the ApiClient class.

Describe the solution you'd like

Replace TODO() calls with catchable exceptions or return null and add an // TODO comment. I've tested both attempts and they worked without crashing the app.

Assignee
Assign to
Time tracking