We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
This following example works as expected
public class JacksonForUpdate { public static class Bean { private String name; private Map<String, Object> properties; public void setName(String name) { this.name = name; } @JsonCreator public Bean(JsonNode node, @JacksonInject ObjectMapper mapper) throws IOException { this.properties = mapper.convertValue(node, Map.class); mapper.readerForUpdating(this).readValue(node); } @Override public String toString() { return "Bean{" + "name='" + name + '\'' + ", properties=" + properties + '}'; } } public static void main(String[] args) throws IOException { ObjectMapper mapper = new ObjectMapper(); // make the mapper to be available for the bean mapper.setInjectableValues(new InjectableValues.Std().addValue(ObjectMapper.class, mapper)); final ObjectNode objectNode = mapper.createObjectNode(); objectNode.put("name", "value"); System.out.println( mapper.treeToValue( objectNode, Bean.class)); } }
The next example fails with an exception: Conflicting setter definitions for property "config":
com.fasterxml.jackson.databind.ObjectMapper#setConfig(1 params) vs com.fasterxml.jackson.databind.ObjectMapper#setConfig(1 params)
public class JacksonForUpdate { public static class Bean { private String name; @JsonCreator public Bean(@JsonProperty("name") String name, @JacksonInject ObjectMapper mapper) throws IOException { this.name = name; } @Override public String toString() { return "Bean{" + "name='" + name + '\'' + '}'; } } public static void main(String[] args) throws IOException { ObjectMapper mapper = new ObjectMapper(); // make the mapper to be available for the bean mapper.setInjectableValues(new InjectableValues.Std().addValue(ObjectMapper.class, mapper)); final ObjectNode objectNode = mapper.createObjectNode(); objectNode.put("name", "value"); System.out.println( mapper.treeToValue( objectNode, Bean.class)); } }
The text was updated successfully, but these errors were encountered:
Hmmh. Interesting. Thank you for reporting this.
Sorry, something went wrong.
I suspect this is same as/related to #962: that is, injectable value being introspected. So sort of secondary fail.
Ok, yes; I think this is duplicate of #962: I will close this one just based on order of reporting, problem itself is valid.
No branches or pull requests
This following example works as expected
The next example fails with an exception: Conflicting setter definitions for property "config":
com.fasterxml.jackson.databind.ObjectMapper#setConfig(1 params) vs com.fasterxml.jackson.databind.ObjectMapper#setConfig(1 params)
The text was updated successfully, but these errors were encountered: