Class ProtoJsonPropertyProjection

Namespace
ProtoTest.Json
Assembly
ProtoTest.Json.dll

Reads a CLR object as the members JSON sees: public, non-indexed properties, honoring JsonPropertyNameAttribute and JsonIgnoreAttribute, with the caller's naming policy as the fallback. One implementation, so request bodies, query strings, GraphQL documents and expected shapes cannot disagree about a wire name.

public static class ProtoJsonPropertyProjection
Inheritance
ProtoJsonPropertyProjection
Inherited Members

Methods

Read(object, JsonNamingPolicy?, bool)

Projects a non-null value's members.

public static IReadOnlyList<ProtoJsonProperty> Read(object value, JsonNamingPolicy? namingPolicy = null, bool honorJsonIgnore = true)

Parameters

value object
namingPolicy JsonNamingPolicy
honorJsonIgnore bool

Returns

IReadOnlyList<ProtoJsonProperty>

Read(Type, object?, JsonNamingPolicy?, bool)

Projects a value's members. A null value still yields the type's shape with null values.

public static IReadOnlyList<ProtoJsonProperty> Read(Type type, object? value, JsonNamingPolicy? namingPolicy = null, bool honorJsonIgnore = true)

Parameters

type Type
value object
namingPolicy JsonNamingPolicy
honorJsonIgnore bool

Returns

IReadOnlyList<ProtoJsonProperty>