From 9f198711c8baca3dfb4f6435cced2395cc013b8e Mon Sep 17 00:00:00 2001 From: Leonid Startsev Date: Fri, 20 Oct 2017 23:22:00 +0300 Subject: Doc quick fix and note about #27 --- docs/custom_serializers.md | 4 ++-- docs/examples.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/custom_serializers.md b/docs/custom_serializers.md index 1b8baa56..632d0d86 100644 --- a/docs/custom_serializers.md +++ b/docs/custom_serializers.md @@ -100,8 +100,8 @@ object MyDataSerializer: KSerializer { By default, all serializers are resolved by plugin statically when compiling serializable class. This gives us type-safety, performance and eliminates reflection usage to minimum. However, if there is no -`@Serializable` annotation of class, in general, it is impossible to know at compile time which serializer to use -- user can define more than one external serializer, or define them in other module, or even it's a class from +`@Serializable` annotation of class, in general, it is impossible to know at compile time which serializer to +use - user can define more than one external serializer, or define them in other module, or even it's a class from library which doesn't know anything about serialization. To support such cases, a concept of `SerialContext` was introduced. Roughly speaking, it's a map where diff --git a/docs/examples.md b/docs/examples.md index 87f2b406..6ed36872 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -239,6 +239,7 @@ assertEquals(data, JSON.parse(ExtDataSerializer, "{a:Str,b:[1,2],c:{lt:LIGHT,dk:DARK}}")) ``` + To obtain serializers for root-level collections, you can use extension functions defined on serializers, like `.list` (see [this](https://github.com/Kotlin/kotlinx.serialization/issues/27) issue) ## User-defined serial annotations In some cases, one may like to save additional format-specific information in the object itself. For example, protobuf field id. -- cgit v1.2.3