<PackageReference Include="System.Text.Json" Version="9.0.0-preview.6.24327.7" />

JsonObjectCreationHandlingAttribute

Determines how deserialization handles object creation for fields or properties.
namespace System.Text.Json.Serialization { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface, AllowMultiple = false)] public sealed class JsonObjectCreationHandlingAttribute : JsonAttribute { public JsonObjectCreationHandling Handling { get; } public JsonObjectCreationHandlingAttribute(JsonObjectCreationHandling handling) { if (!JsonSerializer.IsValidCreationHandlingValue(handling)) throw new ArgumentOutOfRangeException("handling"); Handling = handling; } } }