Skip to content

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

@bascarsija

Description

@bascarsija

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions