You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use a common base class for all model classes that provides a way to transparently preserve unrecognized fields (via @JsonAnySetter/@JsonAnyGetter)
#11
Open
bascarsija opened this issue
Feb 7, 2018
· 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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: