From e5c8e2c3b6d260d1c2b213d73292f8293157f66f Mon Sep 17 00:00:00 2001 From: Georgios Andrianakis Date: Mon, 30 Jan 2023 11:38:00 +0200 Subject: [PATCH] Use new simpler syntax for getting all beans in Jackson related docs --- docs/src/main/asciidoc/rest-json.adoc | 7 +++---- docs/src/main/asciidoc/resteasy.adoc | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/src/main/asciidoc/rest-json.adoc b/docs/src/main/asciidoc/rest-json.adoc index 1fce2982196c6..62be7a6e4496b 100644 --- a/docs/src/main/asciidoc/rest-json.adoc +++ b/docs/src/main/asciidoc/rest-json.adoc @@ -231,10 +231,9 @@ Failure to do so will prevent Jackson specific customizations provided by variou [source,java] ---- import com.fasterxml.jackson.databind.ObjectMapper; +import io.quarkus.arc.All; import io.quarkus.jackson.ObjectMapperCustomizer; - -import javax.enterprise.inject.Instance; -import javax.enterprise.inject.Produces; +import java.util.List; import javax.inject.Singleton; public class CustomObjectMapper { @@ -242,7 +241,7 @@ public class CustomObjectMapper { // Replaces the CDI producer for ObjectMapper built into Quarkus @Singleton @Produces - ObjectMapper objectMapper(Instance customizers) { + ObjectMapper objectMapper(@All List customizers) { ObjectMapper mapper = myObjectMapper(); // Custom `ObjectMapper` // Apply all ObjectMapperCustomizer beans (incl. Quarkus) diff --git a/docs/src/main/asciidoc/resteasy.adoc b/docs/src/main/asciidoc/resteasy.adoc index 9e6a936527aa0..6a439993512d1 100644 --- a/docs/src/main/asciidoc/resteasy.adoc +++ b/docs/src/main/asciidoc/resteasy.adoc @@ -215,16 +215,16 @@ Failure to do so will prevent Jackson specific customizations provided by variou [source,java] ---- import com.fasterxml.jackson.databind.ObjectMapper; +import io.quarkus.arc.All; import io.quarkus.jackson.ObjectMapperCustomizer; - -import javax.enterprise.inject.Instance; +import java.util.List; import javax.inject.Singleton; public class CustomObjectMapper { // Replaces the CDI producer for ObjectMapper built into Quarkus @Singleton - ObjectMapper objectMapper(Instance customizers) { + ObjectMapper objectMapper(@All List customizers) { ObjectMapper mapper = myObjectMapper(); // Custom `ObjectMapper` // Apply all ObjectMapperCustomizer beans (incl. Quarkus)