Foso / Ktorfit

HTTP client generator / KSP plugin for Kotlin Multiplatform (Android, iOS, Js, Jvm, Native, WasmJs)) using KSP and Ktor clients inspired by Retrofit https://foso.github.io/Ktorfit
https://foso.github.io/Ktorfit
Apache License 2.0
1.6k stars 43 forks source link

OpenAPITools/openapi-generator support #491

Open AlexTrotsenko opened 11 months ago

AlexTrotsenko commented 11 months ago

Is your feature request related to a problem? Please describe. Many apps uses Swagger/OpenAPI Specification and OpenAPITools codegen when communicating over http to BackEnd.

Currently migrating existing Retrofit-based app to Ktorfit seems relatively easy task.

However it can't be done for the apps, which are using auto-generated retrofit interface from Swagger definition: manual change is not possible since normally Swagger definition is being regularly updated.

Describe the solution you'd like Add Ktorfit library support (should be similar to the existing jvm-retrofit2) to the Kotlin generator.

Describe alternatives you've considered There is old multiplatform library option, but that one uses "raw" Ktor api and seems to be not very up-to-date (e.g. Ktor 1.6.7 client is mentioned in the docs).

Additional context As far as I see, simple mustache templates are used to customise code generation. Existing jvm-retrofit2 and multiplatform options could be used as the starting point.

E.g. Example of adding kotlinx-datetime to the "old" multiplatform codegen https://github.com/OpenAPITools/openapi-generator/pull/17166/files.

armond-avanes commented 3 months ago

Is there any update on this?

Foso commented 3 months ago

I like the idea, but i don't have time for it. When someone else want to implement it, go for it!