[BUG][Kotlin-Client] Moshi (Serializer/Deserializer) Configuration duplicated in generated code/template
Created by: lemoinem
Bug Report Checklist
-
What's the version of OpenAPI Generator used? master -
Have you search for related issues/PRs? -
What's the actual output vs expected output?
Description
In Kotlin client generated code, the Serialization/Deserialization library's config is duplicated: Once in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache#L65-L72
And once in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/Serializer.kt.mustache which is used at https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache#L49
I believe it would be much easier both for modularity (e.g., https://github.com/OpenAPITools/openapi-generator/issues/2418) and for code maintenance, if the Configuration was in a single place.
Is this something you'd be open to accept a PR about it.
openapi-generator version
master
OpenAPI declaration file content or url
N/A
Command line used for generation
N/A
Steps to reproduce
N/A
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/issues/2418
Suggest a fix
Simply use Serializer.moshi
instead of duplicating the code in responseBody
.