You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduce @AdvancedEncodingApi and @SealedSerializationApi annotations
to be used with @SubclassOptInRequired.
These annotations allow for even more fine-grained API marking. We now can designate APIs
as public for use, but closed for implementation (@SealedSerializationApi) — the case for SerialDescriptor, which is a non-sealed interface for technical reasons.
The other annotation, @AdvancedEncodingApi is aimed to provide guidance on implementing custom encoders/decoders by pointing users to a documentation and guides.
Fixes#2366
open annotation class kotlinx.serialization.encoding/AdvancedEncodingApi : kotlin/Annotation { // kotlinx.serialization.encoding/AdvancedEncodingApi|null[0]
* Copyright 2017-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
3
+
*/
4
+
5
+
packagekotlinx.serialization.encoding
6
+
7
+
/**
8
+
* Marks all encoding- and decoding-related interfaces in kotlinx.serialization.
9
+
* These interfaces are used in serializers and have to be implemented only if you want to write
10
+
* a custom serialization format. Since encoder/decoder invariants are quite complex,
11
+
* it is recommended to start with reading their documentation: see [Encoder] and [Decoder],
12
+
* and [kotlinx.serialization guide](https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/formats.md#custom-formats-experimental) about them.
13
+
* There are also existing skeleton implementations that you may find useful: [AbstractEncoder] and [AbstractDecoder].
14
+
*/
15
+
@RequiresOptIn(
16
+
"You should implement Encoder or Decoder only if you want to write a custom kotlinx.serialization format. "+
17
+
"Before doing so, please consult official guide at https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/formats.md#custom-formats-experimental",
0 commit comments