zhfeng commented on code in PR #3937: URL: https://github.com/apache/camel-quarkus/pull/3937#discussion_r926750153
########## extensions/jackson/runtime/src/main/doc/usage.adoc: ########## @@ -0,0 +1,73 @@ +=== Configuring the Jackson `ObjectMapper` + +There are a few ways of configuring the `ObjectMapper` that the `JacksonDataFormat` uses. These are outlined below. + +==== `ObjectMapper` created internally by `JacksonDataFormat` + +By default, `JacksonDataFormat` will create its own `ObjectMapper` and use the various configuration options on the `DataFormat` +to configure additional Jackson modules, pretty printing and other features. + +==== Custom `ObjectMapper` for `JacksonDataFormat` + +You can pass a custom `ObjectMapper` instance to `JacksonDataFormat` as follows. + +[source,java] +---- +ObjectMapper mapper = new ObjectMapper(); +JacksonDataFormat dataFormat = new JacksonDataFormat(); +dataFormat.setObjectMapper(mapper); +---- + +==== Using the Quarkus Jackson `ObjectMapper` with `JacksonDataFormat` + +The Quarkus Jackson extension exposes an `ObjectMapper` CDI bean which can be discovered by the `JacksonDataFormat`. Review Comment: It could be helpful to mention that you need to include `io.quarkus:quarkus-jackson` in the dependencies. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
