Class ProtoJsonReadSemantics
How one protocol reads JSON: the exception its failures carry and the wording its required-read reasons use. The read itself - parse, resolve the optional path, apply the required null rules and deserialize - lives in ProtoJsonRead, so REST, GraphQL and messaging cannot drift.
public sealed record ProtoJsonReadSemantics : IEquatable<ProtoJsonReadSemantics>
- Inheritance
-
ProtoJsonReadSemantics
- Implements
- Inherited Members
- Extension Methods
Constructors
ProtoJsonReadSemantics(Func<string, Exception>, Func<string, Exception, Exception>, string, string, Action<Exception, string?>?, bool)
How one protocol reads JSON: the exception its failures carry and the wording its required-read reasons use. The read itself - parse, resolve the optional path, apply the required null rules and deserialize - lives in ProtoJsonRead, so REST, GraphQL and messaging cannot drift.
public ProtoJsonReadSemantics(Func<string, Exception> RequiredFailure, Func<string, Exception, Exception> PathMissFailure, string EmptyBodyReason, string NullBodyReason, Action<Exception, string?>? TraceFailure = null, bool NullRootReturnsDefault = false)
Parameters
RequiredFailureFunc<string, Exception>PathMissFailureFunc<string, Exception, Exception>EmptyBodyReasonstringNullBodyReasonstringTraceFailureAction<Exception, string>NullRootReturnsDefaultbool
Properties
EmptyBodyReason
public string EmptyBodyReason { get; init; }
Property Value
NullBodyReason
public string NullBodyReason { get; init; }
Property Value
NullRootReturnsDefault
public bool NullRootReturnsDefault { get; init; }
Property Value
PathMissFailure
public Func<string, Exception, Exception> PathMissFailure { get; init; }
Property Value
RequiredFailure
public Func<string, Exception> RequiredFailure { get; init; }
Property Value
TraceFailure
public Action<Exception, string?>? TraceFailure { get; init; }
Property Value
Methods
NullValueReason(string)
The reason a required read names a JSON-null value at a path with.
public static string NullValueReason(string jsonPath)
Parameters
jsonPathstring