Table of Contents

Class SystemTextJsonAttributes

Namespace
TypedRest.CodeGeneration.CSharp
Assembly
TypedRest.CodeGeneration.CSharp.dll

Annotates DTOs for System.Text.Json.

public sealed class SystemTextJsonAttributes : JsonAttributes
Inheritance
object
SystemTextJsonAttributes
Inherited Members

Properties

Serializer

The name of the serializer these attributes are for.

public override string Serializer { get; }

Property Value

string

Methods

EnumMemberName(string)

Carries the wire name of an enum value whose C# name differs from it.

public override CSharpAttribute EnumMemberName(string name)

Parameters

name string

Returns

CSharpAttribute

Remarks

System.Text.Json ignores [EnumMember]. [JsonStringEnumMemberName] is the attribute its JsonStringEnumConverter reads instead, and it requires .NET 9 or later.

PropertyName(string)

Carries the wire name of a property whose C# name differs from it.

public override CSharpAttribute PropertyName(string name)

Parameters

name string

Returns

CSharpAttribute