-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Description
Generating a Kotlin client for an API that uses BigDecimal in the model, the generated ApiClient doesn't work because the generated Moshi serializer does not have a type adapter for BigDecimal. Unfortunately, there is no way to inject the type adapter yourself.
openapi-generator version
4.3.1
Steps to reproduce
Any API with BigDecimal should demonstrate the problem. Generate Kotlin API and try to send message. I get exception:
java.lang.IllegalArgumentException: Platform class java.math.BigDecimal (with no annotations) requires explicit JsonAdapter to be registered
at com.squareup.moshi.ClassJsonAdapter$1.create(ClassJsonAdapter.java:60) ~[moshi-1.8.0.jar:na]
at com.squareup.moshi.Moshi.adapter(Moshi.java:137) ~[moshi-1.8.0.jar:na]
Suggest a fix
Add BigDecimal adapter here: com.kn.containerDashboard.backend.client.rgs.infrastructure.Serializer
Reactions are currently unavailable