Use DeserializationContext.readTreeAsValue() instead of ObjectCodec.treeToValue()
Apache 2.0In Jackson 3, ObjectCodec is replaced by ObjectReadContext, which does not expose treeToValue. The equivalent method is readTreeAsValue(JsonNode, Class) on DeserializationContext. This recipe rewrites parser.getCodec().treeToValue(node, Foo.class) to ctxt.readTreeAsValue(node, Foo.class) inside methods that have a DeserializationContext parameter (typically JsonDeserializer.deserialize).
org. openrewrite. java. jackson. UseReadTreeAsValueInDeserializermod run . --recipe= org. openrewrite. java. jackson. UseReadTreeAsValueInDeserializerInstall it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.