From 5e263ae7eff8ef411467fe85a657bad92a53446c Mon Sep 17 00:00:00 2001 From: Loic Denuziere Date: Sat, 18 Jun 2022 18:37:52 +0200 Subject: [PATCH] Document JsonKnownNamingPolicy --- docs/Customizing.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/Customizing.md b/docs/Customizing.md index 300486a..d5215e3 100644 --- a/docs/Customizing.md +++ b/docs/Customizing.md @@ -75,8 +75,6 @@ The way to customize the serialization format depends on [how FSharp.SystemTextJ | MyOtherCase of string ``` - Note that due to .NET limitations on the types of arguments that can be passed to an attribute, some options are unavailable for `JsonFSharpConverterAttribute`, such as `unionTagNamingPolicy`. - ## `unionEncoding` The customization option `unionEncoding` defines the format used to encode discriminated unions. @@ -542,6 +540,8 @@ JsonSerializer.Serialize(WithArgs(123, "Hello, world!"), options) // --> {"Case":"withArgs","Fields":[123,"Hello, world!"]} ``` +When using the attribute, this option has enum type `JsonKnownNamingPolicy` instead. + ## `unionFieldNamingPolicy` This option sets the naming policy for union field names. @@ -560,6 +560,8 @@ JsonSerializer.Serialize(Person("John", "Doe"), options) // --> {"Case":"Person","firstName":"John","lastName":"Doe"} ``` +When using the attribute, this option has enum type `JsonKnownNamingPolicy` instead. + ## `unionTagCaseInsensitive` This option only affects deserialization.