Injecting `ObjectMapper` should be possible, yes, but not for property
that comes from JSON.
(since otherwise Jackson will indeed try to deserialize JSON into
`ObjectMapper` and that's not what you want).
But even if you inject a mapper, something would need to use it. So it
is probably not a working solution for your problem.
This is based on some guessing based on description (since there's no code).
On custom deserializer: you probably know it but just in case: there
are multiple ways to register custom deserializers: so instead of
global registration you can use:
@JsonDeserialize(using = MyJsonInJsonDeserializer)
private CustomType values;
But thinking out loud, I wonder if you could instead define a
`Converter` that takes in, say `JsonNode` (or `String`) and then
handles secondary conversion.
@JsonDeserialize(convert = FromJsonConverter.class)
private CustomType values;
where FromJsonConverter would implement `Converter<String, CustomType>`.
... but it still does need `ObjectMapper`, which won't be available
via `DeserializationContext`.
... unless you pass one as Contextual Attribute (see
`ObjectReader.withAttribute(...)`)
-+ Tatu +-
ps. The case of "JSON in JSON" (or "XML in JSON" or generally "X in Y"
for Jackson-supported formats X and Y) is sort of a long-term request
that has never been properly addressed. Assuming I did not misread
the use case here.