diff options
author | Leonid Startsev <sandwwraith@gmail.com> | 2017-10-20 23:22:00 +0300 |
---|---|---|
committer | Leonid Startsev <sandwwraith@gmail.com> | 2017-10-20 23:24:40 +0300 |
commit | 9f198711c8baca3dfb4f6435cced2395cc013b8e (patch) | |
tree | 17ccb65c93c39474a620157069ca906fb9827b00 /docs | |
parent | e009c130082e19669725ceb4bb5211b6711291f2 (diff) | |
download | kotlinx.serialization-9f198711c8baca3dfb4f6435cced2395cc013b8e.tar.gz |
Doc quick fix and note about #27upstream/v0.2
Diffstat (limited to 'docs')
-rw-r--r-- | docs/custom_serializers.md | 4 | ||||
-rw-r--r-- | docs/examples.md | 1 |
2 files changed, 3 insertions, 2 deletions
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<MyData> { 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. |