Skip to content

Commit b51d657

Browse files
committed
Deprecate mutable classDiscriminatorMode in JsonConfiguration
1 parent 937c8ef commit b51d657

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

formats/json/commonMain/src/kotlinx/serialization/json/JsonConfiguration.kt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ public class JsonConfiguration @OptIn(ExperimentalSerializationApi::class) inter
3939
@ExperimentalSerializationApi
4040
public val allowComments: Boolean = false,
4141
@ExperimentalSerializationApi
42+
@set:Deprecated(
43+
"JsonConfiguration is not meant to be mutable, and will be made read-only in a future release. " +
44+
"The `Json(from = ...) {}` copy builder should be used instead.",
45+
level = DeprecationLevel.ERROR
46+
)
4247
public var classDiscriminatorMode: ClassDiscriminatorMode = ClassDiscriminatorMode.POLYMORPHIC,
4348
) {
4449

0 commit comments

Comments
 (0)