swagger-api / swagger-codegen

swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.
http://swagger.io
Apache License 2.0
17.05k stars 6.03k forks source link

[Kotlin] support Kotshi #7573

Open magiepooh opened 6 years ago

magiepooh commented 6 years ago
Description

Kotshi is an annotations processor that generates Moshi adapters from immutable Kotlin data classes. https://github.com/ansman/kotshi

Codegen for Kotlin uses Moshi, but Kotshi is faster than using Moshi.

Suggest a fix/enhancement

generate -i swagger.yaml -l kotlin -o out -D useKotshi=true

PerfectedApp commented 6 years ago

Does kotshi require and only use a data class?

ansman commented 6 years ago

Kotshi doesn't care about if it's a data class or not, but it does require a constructor with all the properties to be present, like in a data class.

SirBif commented 6 years ago

Moshi now has its own codegen: