[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.