Table of Contents

Class JsonDefaults

Namespace
JD.AI.Core.Infrastructure
Assembly
JD.AI.Core.dll

Canonical JSON serialization options. Use these instead of creating new JsonSerializerOptions instances throughout the codebase.

public static class JsonDefaults
Inheritance
JsonDefaults
Inherited Members

Properties

Compact

Compact options: camelCase, no indentation. Suitable for wire formats, storage, and contexts where size matters.

public static JsonSerializerOptions Compact { get; }

Property Value

JsonSerializerOptions

Indented

Indented-only options: PascalCase (default), indented output. Suitable for tool output where property names should not be transformed.

public static JsonSerializerOptions Indented { get; }

Property Value

JsonSerializerOptions

Options

Default options: camelCase, relaxed parsing, indented output. Suitable for tool output, user-facing JSON, and general use.

public static JsonSerializerOptions Options { get; }

Property Value

JsonSerializerOptions

Strict

Strict options: PascalCase, no relaxation. Suitable for API contracts and formal serialization.

public static JsonSerializerOptions Strict { get; }

Property Value

JsonSerializerOptions

Methods

Deserialize<T>(string)

Deserialize JSON using default options.

public static T? Deserialize<T>(string json)

Parameters

json string

Returns

T

Type Parameters

T

Deserialize<T>(JsonElement)

Deserialize a JSON element using default options.

public static T? Deserialize<T>(JsonElement element)

Parameters

element JsonElement

Returns

T

Type Parameters

T

SerializeCompact<T>(T)

Serialize an object using compact options.

public static string SerializeCompact<T>(T value)

Parameters

value T

Returns

string

Type Parameters

T

Serialize<T>(T)

Serialize an object using default options.

public static string Serialize<T>(T value)

Parameters

value T

Returns

string

Type Parameters

T