-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Deserialization issue with @JsonIgnore
and @JsonCreator
+ @JsonProperty
for same property name
#2001
Comments
One quick note: example is ambiguous, and I wonder if it should fail -- first constructor is given two different names ("rawQuery", "query"), and it is not clear as to which one should be used. So maybe it's just matter of clarifying that this is indeed the proper annotation precedence... |
That is my thinking. Exact same behaviour without additional ctor props annotation is triggered in Kotlin: Actual behaviour is here: Lines 481 to 482 in f350b20
Named ctor param name is reported as implicit property name, thus property initially gets "rawQuery" name upon discovery, then is renamed to "query" in rename phase. When same property exists in the class with What do you think? |
@JsonIgnore
and @JsonCreator
+ @JsonProperty
for same property name
@jskierbi In case of constructor parameter/argument this is fully defined since that is consider "implicit" name, similar to name detected from "getX()": explicit annotation does have precedence. |
Issue originally found on jackson-module-kotlin: FasterXML/jackson-module-kotlin#124. Issue reproducible with Java code.
Entity class:
Fails this test:
The text was updated successfully, but these errors were encountered: