You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
else -> TODO("responseBody currently only supports JSON body.")
}
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.
The text was updated successfully, but these errors were encountered:
I opened #3611 to change TODO() to throw UnsupportedOperationException. What are your thoughts on this exception type rather than some custom exception?
The use of the Kotlin function TODO() can IMO be dangerous sometimes. For example here:
openapi-generator/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache
Lines 60 to 63 in 4d28593
When
mediaType
is notapplication/json
the app or program, in which the client is used, just crashes. AFAIK there is no way to catch these exceptions without modifying theApiClient
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.The text was updated successfully, but these errors were encountered: