Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Comments

@bascarsija
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant