[REQ] [Kotlin] Switch between Moshi and Jackson depending on import library
Created by: herveDarritchon
Is your feature request related to a problem? Please describe.
Currently with the Kotlin generator, there is no choice in the library used for marshalling/unmarshalling. Kotling codegen uses Moshi (may be because of the android history).
But when you use Jersey, Ktor ou Spring, you use more often Jackson than Moshi or at least Gson.
Because of this automatic import, you have to had Moshi in your build if you use codegen even if it is not really used. Moreover with Enum not respecting code convention you have runtime issue because Jackson is used to unmarshall you json string and the moshi annotation is not used. One solution is to change the template to use Jackson instead of moshi but what's happening if you use moshi in your project ?
The good thing should be to work as in Java codegen, depending on the library imported, you use Moshi annotation or Jackson or Gson.
see issue swagger-codegen 7811 (https://github.com/swagger-api/swagger-codegen/issues/7811) for more details.
Describe the solution you'd like
I'd like to be able to choose the lib for marshalling/unmarshalling imported and used by the code generated by openapi codegen
Describe alternatives you've considered
I have thought about using a specific template using Jackson but it's not a good solution for me because you're duplicating efforts.
Additional context
I'd like to make the pull request but before doing it I'd like to know if you think it is valuable for the community ;) and it can be integrated later if it works, it has the good quality :)