This fixes #162 by introducing the following format option:
type MapFormat =
/// Always serialize Maps as JSON objects.
/// Only supports the same key types as the built-in serializer for Dictionary.
/// Requires System.Text.Json 8.0 or newer.
| Object = 0
/// Always serialize Maps as JSON arrays whose items are [key, value] JSON arrays.
/// Supports all key types.
| ArrayOfPairs = 1
/// Serialize Maps as JSON objects if the key type is string or a single-case union wrapping string;
/// otherwise, serialize Maps as JSON arrays whose items are [key, value] JSON arrays.
/// Supports all key types.
/// This is the default format.
| ObjectOrArrayOfPairs = 2
This fixes #162 by introducing the following format option:
Note:
Object
requires System.Text.Json 8.0 due to https://github.com/dotnet/runtime/issues/77326.