grafana-api-java-client icon indicating copy to clipboard operation
grafana-api-java-client copied to clipboard

Use a common base class for all model classes that provides a way to transparently preserve unrecognized fields (via @JsonAnySetter/@JsonAnyGetter)

Open bascarsija opened this issue 7 years ago • 0 comments

Not all fields from the Grafana API model are currently represented in the model classes, resulting in data loss when, for example, copying an dashboard and uploading the result.

Fortunately, Jackson provides "@JsonAnyGetter" and "@JsonAnySetter" to transparently preserve such recognized fields.

Additionally, this would provide for a stopgap workaround to get/put fields not represented in the model classes if their Grafana version (and therefore its API models) were updated before this project is able to add the new fields to the model classes.

Please note that I have created a fork that already implements this, and can produce a PR if this functionality is desired in the main code base.

bascarsija avatar Feb 07 '18 02:02 bascarsija