API-friendly data classes: <github.com/xemantic/xe...
# feed
k
K 2
m
How does this compare to Poko? github.com/drewhamilton/Poko
k
I checked poko a while ago for my purposes, and even wanted to use it, but then decided that it would be more expensive to extend it for my needs, than to write new compiler plugin from scratch. 1. I need a special builder, named the same as the constructor (constructor is becoming private), for every API data class. 2. This way any evolution of the API data class, including reordering of properties according to code generated froa OpenAPI JSON schema, is remaining forward-backward compatible. 3. In addition copy function, which Poko does not support, is supported through the builder. 4. These generated builders also suport default parameter declared on the constructor properties, including lazy-evaluated properties. I am switching all my SDKs, and SDK generators to the new plugin now - e.g. anthropic-sdk-kotlin, openai-sdk-kotlin: github.com/xemantic/anthropic-sdk-kotlin It will reduce the amount of boilerplate to 0, allowing perfect generation of minimal Kotlin multiplatform code out of JSON schema.
👍🏻 1
thank you color 1