Hi all. i am trying to generate kotlin from a Yaml...
# server
v
Hi all. i am trying to generate kotlin from a Yaml file (with swagger codegen). And i have a lot of dependency problem, does anyone has already try it ?
m
If you aren't already, I'd suggest using this generator. https://openapi-generator.tech If you're using the above linked generator, then I have some experience with it, so may be able to help.
1
v
thanks i will check with this library
a
This plugin is also interesting: https://github.com/int128/gradle-swagger-generator-plugin I do not really like automatic code generation tools, but this is easy to use.
m
The int128 one hasn't been updated in 5 months, and just refernces the openapi-generator. I'd suggest just using the openapi-generator directly. I've found it very easy to use, and actively maintained.
d
data point. I have most recently tried and used this gradle plugin: id 'org.hidetake.swagger.generator' version '2.16.0' Took a few tries at others to find the one with the versions of codegen that worked for me. its not anything fancier then a plugin for swagger-codegen, but does work and supports ALL the parameters (ya the ones you cant find in the docs) for codgen. Recently used it to codegen a java and kotlin set of client API's for a public swagger API. Easily accepted some template mods and confiigs to 'tune' the kotlin codegen, particulary the class names if the spec doesnt use operation id.
✔️ 1
m
This looks like it wraps/leverages the generator I linked above for code generation. And then provides some additional options for using other generators to produce other items. Note that OpenAPI generator is now on 4+, and this is using 3. One thing I like about the OpenAPI fork of swagger gen is it doesn't require different versions of the generator to target v2 and v3 of the Specification.
d
That part was annoying (getting the right version) -- was difficult even figuring out there were versions, where they were and what they did.
546 Views