Class OpenApiMockSchemaSource

Namespace
Kuestenlogik.Bowire.Protocol.Rest.Mock
Assembly
Kuestenlogik.Bowire.Protocol.Rest.dll

REST plugin's contribution to the Bowire mock server's schema-only flow. When the user runs bowire mock --schema <path>, the mock server discovers this IBowireMockSchemaSource (Kind = "openapi") and delegates the schema → recording conversion to whichever IBowireOpenApiAdapter is registered (OpenApi2 / OpenApi3, depending on the adapter package pulled in by the host).

public sealed class OpenApiMockSchemaSource : IBowireMockSchemaSource
Inheritance
OpenApiMockSchemaSource
Implements
Inherited Members

Remarks

Implementation moved from Kuestenlogik.Bowire.Mock.Schema to here as part of the mock plugin-isation refactor — the Microsoft.OpenApi.Readers dependency now hangs only on the REST plugin (where it was already needed for endpoint discovery) instead of on Kuestenlogik.Bowire.Mock.

Constructors

OpenApiMockSchemaSource()

public OpenApiMockSchemaSource()

Properties

Kind

Schema kind id matching the CLI flag — "openapi" for --schema, "protobuf" for --grpc-schema, "graphql" for --graphql-schema.

public string Kind { get; }

Property Value

string

Methods

BuildAsync(string, CancellationToken)

Build a BowireRecording from the schema file at path. Implementations may throw InvalidDataException for malformed schemas — the host catches and surfaces the message.

For schema kinds whose responses are dispatch-time-dependent (e.g. GraphQL — the response shape varies with the selection set), implementations may return an empty recording and rely on a companion middleware. See IBowireMockLiveSchemaHandler for that path.

public Task<BowireRecording> BuildAsync(string path, CancellationToken ct)

Parameters

path string
ct CancellationToken

Returns

Task<BowireRecording>