You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/08/02 17:09:34 UTC

[GitHub] [camel-quarkus] jamesnetherton commented on a diff in pull request #3952: Add more details to the Jackson ObjectMapper usage section

jamesnetherton commented on code in PR #3952:
URL: https://github.com/apache/camel-quarkus/pull/3952#discussion_r935834637


##########
docs/modules/ROOT/pages/reference/extensions/jackson.adoc:
##########
@@ -67,18 +77,30 @@ The Quarkus Jackson extension exposes an `ObjectMapper` CDI bean which can be di
 
 [source,java]
 ----
-ObjectMapper mapper = new ObjectMapper();
-JacksonDataFormat dataFormat = new JacksonDataFormat();
-// Make JacksonDataFormat discover the Quarkus Jackson `ObjectMapper` from the Camel registry
-dataFormat.setAutoDiscoverObjectMapper(true);
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jackson.JacksonDataFormat;
+
+public class Routes extends RouteBuilder {
+    public void configure() {
+        ObjectMapper mapper = new ObjectMapper();

Review Comment:
   My mistake here. You don't actually need to instantiate `ObjectMapper` in this scenario because `JacksonDataFormat` will resolve the Quarkus one from the Camel registry.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org