You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 7, 2019. It is now read-only.
public A {
private final String title;
public A(String title) {
this.title = title;
}
}
When I serialize this (with private field visibility) I get:
{
"title" : "Alice in Wonderland",
}
When deserializing (with new ParameterNamesModule(Mode.PROPERTIES)) I however get this exception:
com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of A (although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)
What is ambigious here? There is a creator, but it refuses to use it, even though the properties are matches for the parameter names.
If I add a @JsonProperty annotation or a 2nd parameter, the ambiguity disappears. Is it really impossible to tell Jackson to neverever attempt deserializing by passing in a piece of JSON string text? I never want it to use Mode.DELEGATING...
I have a simple class:
When I serialize this (with private field visibility) I get:
When deserializing (with
new ParameterNamesModule(Mode.PROPERTIES)) I however get this exception:com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot construct instance of
A(although at least one Creator exists): cannot deserialize from Object value (no delegate- or property-based Creator)What is ambigious here? There is a creator, but it refuses to use it, even though the properties are matches for the parameter names.
If I add a @JsonProperty annotation or a 2nd parameter, the ambiguity disappears. Is it really impossible to tell Jackson to never ever attempt deserializing by passing in a piece of JSON string text? I never want it to use Mode.DELEGATING...