diff --git a/src/GameCult.Caching/Contracts/cultcache-persistence-format.md b/src/GameCult.Caching/Contracts/cultcache-persistence-format.md index 966b2a1f..81c5eef3 100644 --- a/src/GameCult.Caching/Contracts/cultcache-persistence-format.md +++ b/src/GameCult.Caching/Contracts/cultcache-persistence-format.md @@ -447,7 +447,9 @@ elements retargets nothing. `[MessagePackObject]` type is read by key even when it is `IEnumerable`; MessagePack writes a keyed type that is also a collection (`ICollection`, `IList`, `IDictionary`) as a collection, so C# refuses such a type at the first encode or decode when it is on the - path to an object list. For an + path to an object list. A `[DataContract]` type the walk reads as a collection, which + MessagePack writes by its members, is refused the same way. A formatter MessagePack's + source generator emits is not refused. For an object list, C# refuses at registration a concrete element type that is not keyed and `[MessagePackFormatter]` on any type, collection type or member on the way to the list or on the id member, and refuses at the first encode or decode of the document a formatter diff --git a/src/GameCult.Caching/Contracts/cultcache-store-composition.md b/src/GameCult.Caching/Contracts/cultcache-store-composition.md index f2990a3a..60b5c4ca 100644 --- a/src/GameCult.Caching/Contracts/cultcache-store-composition.md +++ b/src/GameCult.Caching/Contracts/cultcache-store-composition.md @@ -303,11 +303,13 @@ exclusive open of the same lock file exclude each other is not established. type does not claim it (registration refuses a non-public `[Key]` member on the way to an object list, so the private-member formatter writes every id). A value list (`List`, a list of a non-keyed class) is not on the path, so a resolver may claim it. -- The codec also checks, for every type on that path, that `StandardResolver` writes it - the way the walk reads it. A type read by key must be written by the object or union - resolver; a collection must be written by a collection resolver (generic, immutable or - builtin). Otherwise the codec refuses the document on first encode or decode, naming the - type. It also refuses, typed, a type MessagePack cannot build a formatter for, and a +- The codec also checks, for every type on that path, that `StandardResolver` does not write it + against the walk. A type read by key may not be written by the generic collection resolver + (a `[MessagePackObject]` class that is also an `ICollection` or dictionary), and a type + read as a collection may not be written by the object resolver (a `[DataContract]` + enumerable); either is refused on first encode or decode, naming the type. Any other + formatter, such as one MessagePack's source generator emits, passes: the walk decides which + types carry ids. It also refuses, typed, a type MessagePack cannot build a formatter for, and a resolver that throws while asked about one. - Deserialization runs under untrusted-data security. `CultRecordRef` is a permitted dictionary key, compared by its key string.