grafana-api-java-client
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)
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.