FasterXML / jackson-annotations

Core annotations (annotations that only depend on jackson-core) for Jackson data processor
https://github.com/FasterXML/jackson
Apache License 2.0
1.03k stars 330 forks source link

JsonAlias unable to deserialize non-alphabetic keys #142

Closed rng125894 closed 6 years ago

rng125894 commented 6 years ago

Version: Jackson-annotations = 2.9.x;

The @JsonAlias() annotation seems to only work for alphabetical keys in the JSON file, but not ones with non-alphabetic keys (i.e. starts with the "@" symbol) - though have not tested if it fails with anything else. It fails in grabbing the correct values for the given key.

Input (deserialization):

{
     "@key": "value"
}

Object:

@JsonAlias("@key")
String key;

Expected Output (serialization):

{
     "key": "value"
}

Actual Output (serialization):

{
     //Nothing because can't deserialize value of "@key" into key attribute
}