package io.quarkus.jsonb;

import javax.enterprise.context.Dependent;
import javax.enterprise.inject.Instance;
import javax.enterprise.inject.Produces;
import javax.inject.Singleton;
import javax.json.bind.Jsonb;
import javax.json.bind.JsonbBuilder;
import javax.json.bind.JsonbConfig;

import io.quarkus.arc.DefaultBean;

@Singleton
public class JsonbProducer {

    @Produces
    @Dependent //JsonbConfig is not thread safe so it must not be made singleton.
    @DefaultBean
    public JsonbConfig jsonbConfig(Instance<JsonbConfigCustomizer> customizers) {
        JsonbConfig jsonbConfig = new JsonbConfig();
        for (JsonbConfigCustomizer customizer : customizers) {
            customizer.customize(jsonbConfig);
        }
        return jsonbConfig;
    }

    @Produces
    @Singleton
    @DefaultBean
    public Jsonb jsonb(JsonbConfig jsonbConfig) {
        return JsonbBuilder.create(jsonbConfig);
    }
}

@@ -20,16 +20,40 @@
 jsonb;%0A%0A
+import java.util.List;%0A%0A
 import j
@@ -91,49 +91,8 @@
 nt;%0A
-import javax.enterprise.inject.Instance;%0A
 impo
@@ -263,16 +263,43 @@
 onfig;%0A%0A
+import io.quarkus.arc.All;%0A
 import i
@@ -519,16 +519,17 @@
 fig(
-Instance
+@All List
 %3CJso

Make sure JsonbConfigCustomizers are sorted by @Priority