Skip to content

Commit

Permalink
Document JsonKnownNamingPolicy
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarmil committed Jun 18, 2022
1 parent 7896d06 commit 5e263ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/Customizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 5e263ae

Please sign in to comment.