AIJsonUtilities.DefaultOptions Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the JsonSerializerOptions singleton used as the default in JSON serialization operations.
public:
static property System::Text::Json::JsonSerializerOptions ^ DefaultOptions { System::Text::Json::JsonSerializerOptions ^ get(); };
public static System.Text.Json.JsonSerializerOptions DefaultOptions { get; }
static member DefaultOptions : System.Text.Json.JsonSerializerOptions
Public ReadOnly Property DefaultOptions As JsonSerializerOptions
Property Value
Remarks
For Native AOT or applications disabling IsReflectionEnabledByDefault this instance includes source generated contracts for all common exchange types contained in the Microsoft.Extensions.AI.Abstractions library.
It additionally turns on the following settings:
- Enables the WriteIndented property.
- Enables string based enum serialization as implemented by JsonStringEnumConverter.
- Enables WhenWritingNull as the default ignore condition for properties.
- Enables UnsafeRelaxedJsonEscaping when escaping JSON strings. Consuming applications must ensure that JSON outputs are adequately escaped before embedding in other document formats, such as HTML and XML.