Namespace ProtoTest.Json
Classes
- JsonDiagnosticOptions
Options for diagnostic rendering: what is redacted, and how much of a body survives into the trace and the reports.
- JsonDiagnosticSanitizer
Turns a captured body into evidence that is safe to keep and readable in the viewer.
- JsonPathException
Reports that a JSON path did not resolve against a parsed document. The message names the path and the reason; a protocol read wraps it in its own assertion exception, which adds the subject the read was made against.
- JsonPathResolver
Resolves the JSON path subset the response reads accept:
$for the document root, dot members (\(.customer.id</code>) and zero-based array indices (<code>\).items[0].id). A leading member without\(</code> is accepted as <code>\).member. Members match case-sensitively; filters, wildcards, quoted names and slices are deliberately not part of the subset.
- JsonScalarTypes
One definition of what counts as a scalar (non-structured) value, shared by the shape matcher, the GraphQL selection and literal writers so "is this a leaf" cannot drift between them.
- JsonUnmentionedField
One field that arrived in the actual JSON but that no mentioned path covers: its JSON path and its value. An unmentioned branch reports its shallowest path once, not every leaf below it.
- JsonValue
The matchers an assertion can hold a JSON scalar to.
- ProtoDiagnosticCaptureOptions
Capture and redaction options every protocol's attachment configuration shares: whether request bodies, responses and expected shapes are captured, plus the redaction settings from JsonDiagnosticOptions. A protocol adds only what is genuinely its own, such as HTTP's sensitive headers and query parameters.
- ProtoFailureDiagnostics
The sanitized facts shared by every failed call in every protocol, so REST, GraphQL, gRPC and messaging redact and report a failure the same way: the address and the message pass the shared redaction rules, and cancellation is recognized from either the token or the exception type.
- ProtoJsonDefaults
Shared serializer defaults, so every protocol reads and writes JSON the same way. Options freeze on first use; nothing in the framework mutates these instances.
- ProtoJsonPropertyProjection
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.
- ProtoJsonRead
The shared JSON read: it parses the document, resolves the optional path, applies the required null checks before the deserializer sees them and deserializes with the shared reader defaults. A protocol keeps only its exception type and its trace vocabulary, supplied through ProtoJsonReadSemantics; every failure is handed to that protocol's trace sink once.
- 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.
- ProtoObservationCapture
Records a diagnostic observation without ever hiding the failure that produced it: a failure while building diagnostics is traced as evidence and swallowed, because the original exception is what the caller must see. The protocol's identity supplies the event kind, name and source, so a GraphQL capture failure is never attributed to HTTP and every protocol traces the same way.
- ProtoShapeAssertion
The one traced shape assertion REST, GraphQL, gRPC and messaging share. It records the
assert.json.shapeoperation with the expected and actual JSON, the matched properties or every mismatch, captures the expected shape when the protocol asks for it, and fails the operation before rethrowing, so the evidence is in the trace even when the test fails.
- ProtoShapeAssertionContext
The context of one traced shape assertion: where it records, under which parent, with which extra attributes, and whether the expected shape is captured as an attachment.
Structs
- ProtoJsonProperty
One wire-shaped member of a CLR object: the name JSON uses, the declared type and the value.
Interfaces
- IJsonValueMatcher
Matches one JSON scalar value and describes the expectation on mismatch, so a failed assertion says what it wanted.