Skip to content

Allow specifying @JacksonInject does not fail when there's no corresponding value #3072

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

Closed
retrodaredevil opened this issue Mar 8, 2021 · 2 comments
Labels
2.20 Issues planned at 2.20 or later
Milestone

Comments

@retrodaredevil
Copy link

When something is annotated with @JacksonInject, if the ObjectMapper doesn't have injectable values set, it will fail with Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No 'injectableValues' configured, cannot inject value with id [<name of injectable value>]. And there's a different error if the value doesn't exist on the injectable values object.

I'd like to be able to annotation things with @JacksonInject like so:

@JacksonInject(value = "myValue", optional = true)
private String myValue;

Additionally, there could also be a DeserializationFeature called something like FAIL_ON_UNKNOWN_INJECT_VALUE that defaults to true.

@retrodaredevil retrodaredevil added the to-evaluate Issue that has been received but not yet evaluated label Mar 8, 2021
@cowtowncoder cowtowncoder added 2.14 and removed 2.13 to-evaluate Issue that has been received but not yet evaluated labels Jul 15, 2021
@jtamm-red
Copy link

+1

@cowtowncoder cowtowncoder removed the 2.14 label Mar 2, 2024
giulong added a commit to giulong/jackson-databind that referenced this issue May 3, 2025
giulong added a commit to giulong/jackson-databind that referenced this issue May 9, 2025
giulong added a commit to giulong/jackson-databind that referenced this issue May 9, 2025
…ect-spike

feat(FasterXML#3072): moving JacksonInject annotation introspection during des…
giulong added a commit to giulong/jackson-databind that referenced this issue May 9, 2025
@cowtowncoder cowtowncoder changed the title Make @JacksonInject not fail when there's no corresponding value Allow specifying @JacksonInject does not fail when there's no corresponding value May 9, 2025
@cowtowncoder cowtowncoder added the 2.20 Issues planned at 2.20 or later label May 9, 2025
@cowtowncoder cowtowncoder added this to the 2.20.0 milestone May 9, 2025
@cowtowncoder
Copy link
Member

This has been implemened via #5131, to be included in 2.20.0 release (which is still months away).
Although also part of 3.0.0-rc4 which will be out soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.20 Issues planned at 2.20 or later
Projects
None yet
Development

No branches or pull requests

3 participants