From 82019a6d47af3acfb0ebea516a634785f8fd57dc Mon Sep 17 00:00:00 2001 From: Guillaume Smet Date: Fri, 17 Nov 2023 15:39:27 +0100 Subject: [PATCH] Update Kotlinx Serialization JsonConfig --- .../kotlin/serialization/common/runtime/JsonConfig.java | 7 +++++++ .../kotlin/serialization/common/runtime/JsonProducer.kt | 1 + 2 files changed, 8 insertions(+) diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/java/io/quarkus/resteasy/reactive/kotlin/serialization/common/runtime/JsonConfig.java b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/java/io/quarkus/resteasy/reactive/kotlin/serialization/common/runtime/JsonConfig.java index df47f1c32e7c0..bc64347ff3d76 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/java/io/quarkus/resteasy/reactive/kotlin/serialization/common/runtime/JsonConfig.java +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/java/io/quarkus/resteasy/reactive/kotlin/serialization/common/runtime/JsonConfig.java @@ -129,6 +129,12 @@ public class JsonConfig { @ConfigItem(defaultValue = "false") public boolean decodeEnumsCaseInsensitive = false; + /** + * Specifies if trailing comma is allowed. + */ + @ConfigItem(defaultValue = "false") + public boolean allowTrailingComma = false; + @Override public String toString() { return new StringJoiner(", ", JsonConfig.class.getSimpleName() + "[", "]") @@ -144,6 +150,7 @@ public String toString() { .add("allowSpecialFloatingPointValues=" + allowSpecialFloatingPointValues) .add("useAlternativeNames=" + useAlternativeNames) .add("decodeEnumsCaseInsensitive=" + decodeEnumsCaseInsensitive) + .add("allowTrailingComma=" + allowTrailingComma) .toString(); } } diff --git a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/kotlin/io/quarkus/resteasy/reactive/kotlin/serialization/common/runtime/JsonProducer.kt b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/kotlin/io/quarkus/resteasy/reactive/kotlin/serialization/common/runtime/JsonProducer.kt index 45ea46cde67a8..89dc0289b1104 100644 --- a/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/kotlin/io/quarkus/resteasy/reactive/kotlin/serialization/common/runtime/JsonProducer.kt +++ b/extensions/resteasy-reactive/quarkus-resteasy-reactive-kotlin-serialization-common/runtime/src/main/kotlin/io/quarkus/resteasy/reactive/kotlin/serialization/common/runtime/JsonProducer.kt @@ -38,6 +38,7 @@ class JsonProducer { useAlternativeNames = configuration.json.useAlternativeNames useArrayPolymorphism = configuration.json.useArrayPolymorphism decodeEnumsCaseInsensitive = configuration.json.decodeEnumsCaseInsensitive + allowTrailingComma = configuration.json.allowTrailingComma configuration.json.namingStrategy.ifPresent { strategy -> loadStrategy(this, strategy, this@JsonProducer)