How can we generate code for our events? #103
Replies: 1 comment
-
I think this will be very valuable, especially early on when the spec is more "alive". It will be a mess to try to keep all SDKs up to date without this (assuming we want to have several SDKs to broaden adoption). The Quicktype solution you linked above seems nice in that it supports multiple output languages. Unfortunately for me it is written in Typescript, which I have never worked with, so modifying it will be trickier for me.
A fantastic advantage is perhaps obviously that if we do this correctly we can update and verify several SDKs without actually having to manually update any source code files. A disadvantage I frequently run into when trying to generate code is that the generated code just looks a bit...off... And I end up wanting to re-write everything from scratch... |
Beta Was this translation helpful? Give feedback.
-
Instead of writing all code for generating events by hand can we use any framework for this?
In Java, we have https://github.com/joelittlejohn/jsonschema2pojo which can be tested on https://www.jsonschema2pojo.org/
There is also https://github.com/quicktype/quicktype that can be tried on https://app.quicktype.io/
How should we use these libraries?
What are the advantages/disadvantages for using something like this?
Beta Was this translation helpful? Give feedback.
All reactions