growthbook / growthbook-sdk-java

The Java SDK for GrowthBook (JVM, Android)
https://docs.growthbook.io/lib/java
MIT License
7 stars 10 forks source link

Add more types #3

Closed tinahollygb closed 1 year ago

tinahollygb commented 1 year ago

Code generation with Lombok

These changes add Lombok for generating:

JSON support with Gson

Internally I plan on using Gson to help with JSON serialization.

I'm going to require a .toJson() method as well as a custom serializer for every type that needs to have different JSON output, e.g. Namespace I'll use id, rangeStart, and rangeEnd properties, but in JSON it's expected to be ["some_id", 0, 0.6] for example.

You can see the Namespace tests for an example.

Docs

Adds some generated docs.

Unfortunately, getting the Java docs picked up for the Lombok-generated methods is going to be a bit of error. Lombok offers Delombok, a tool that you can use to de-Lombok. I've read that this can help with the Java doc generation. I've created a ticket for this: https://github.com/growthbook/growthbook-sdk-java/issues/4

image