Skip to content

Add a way to define property name aliases #1029

@cowtowncoder

Description

@cowtowncoder

Although it is possible to use a work-around for accepting alternate property names (by adding secondary setters), it would probably be better to allow an explicit annotation support.
This could be something as easy as:

 @JsonProperty(value="name", alias={ "oldName", "anotherOldName" })

and would work so that alternative names would be also accepted, but would not be considered the primary name (would not affect serialization for example).

This feature would seem most useful for versioning purposes, to essentially allow for renaming of properties. This is how other formats like Avro handle backwards compatibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions