Class RecordingSourceSchema

Namespace
Kuestenlogik.Bowire.Mocking
Assembly
Kuestenlogik.Bowire.dll

The source-schema document a recording was captured from — carried on SourceSchema when the live target advertised one. Lets the mock server serve the original contract back (REST: GET /openapi.json, AsyncAPI: GET /asyncapi.yaml) so peer discovery against the mock returns the full declared surface rather than the slice the recording happens to cover.

public sealed record RecordingSourceSchema : IEquatable<RecordingSourceSchema>
Inheritance
RecordingSourceSchema
Implements
Inherited Members

Constructors

RecordingSourceSchema(string, string, string?)

The source-schema document a recording was captured from — carried on SourceSchema when the live target advertised one. Lets the mock server serve the original contract back (REST: GET /openapi.json, AsyncAPI: GET /asyncapi.yaml) so peer discovery against the mock returns the full declared surface rather than the slice the recording happens to cover.

public RecordingSourceSchema(string Format, string Content, string? SourceUrl = null)

Parameters

Format string

Schema format tag — "openapi-3.0", "openapi-2.0", "asyncapi-3.0", "asyncapi-2.6", "graphql-sdl", "wsdl-1.1", &c. Mock-host extensions inspect this to decide whether they're the right handler for this recording's schema.

Content string

Verbatim source-schema text (YAML or JSON, depending on Format). The mock host serves this byte-for-byte under the matching endpoint.

SourceUrl string

Optional capture-time URL the schema came from (e.g. https://api.example.com/openapi.json). Diagnostic only; not used by the mock host. Lets a user pop a recording open and see "this is the contract that lived at <url> when we captured."

Properties

Content

Verbatim source-schema text (YAML or JSON, depending on Format). The mock host serves this byte-for-byte under the matching endpoint.

[JsonPropertyName("content")]
public string Content { get; init; }

Property Value

string

Format

Schema format tag — "openapi-3.0", "openapi-2.0", "asyncapi-3.0", "asyncapi-2.6", "graphql-sdl", "wsdl-1.1", &c. Mock-host extensions inspect this to decide whether they're the right handler for this recording's schema.

[JsonPropertyName("format")]
public string Format { get; init; }

Property Value

string

SourceUrl

Optional capture-time URL the schema came from (e.g. https://api.example.com/openapi.json). Diagnostic only; not used by the mock host. Lets a user pop a recording open and see "this is the contract that lived at <url> when we captured."

[JsonPropertyName("sourceUrl")]
public string? SourceUrl { get; init; }

Property Value

string

Methods

Deconstruct(out string, out string, out string?)

public void Deconstruct(out string Format, out string Content, out string? SourceUrl)

Parameters

Format string
Content string
SourceUrl string

Equals(RecordingSourceSchema?)

public bool Equals(RecordingSourceSchema? other)

Parameters

other RecordingSourceSchema

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(RecordingSourceSchema?, RecordingSourceSchema?)

public static bool operator ==(RecordingSourceSchema? left, RecordingSourceSchema? right)

Parameters

left RecordingSourceSchema
right RecordingSourceSchema

Returns

bool

operator !=(RecordingSourceSchema?, RecordingSourceSchema?)

public static bool operator !=(RecordingSourceSchema? left, RecordingSourceSchema? right)

Parameters

left RecordingSourceSchema
right RecordingSourceSchema

Returns

bool