Class RecordingLoader
- Namespace
- Kuestenlogik.Bowire.Mock.Loading
- Assembly
- Kuestenlogik.Bowire.Mock.dll
Loads a Bowire recording from disk. Accepts two on-disk shapes:
- The full recordings-store envelope
{"recordings":[...]}as written by~/.bowire/recordings.json. If the store contains exactly one recording, it is returned; otherwise Load(string, string?) throws unless anameoridis supplied. - A single-recording document at the top level —
{"id": ..., "steps": [...]}— for mocks that live next to the code they mock.
public static class RecordingLoader
- Inheritance
-
RecordingLoader
- Inherited Members
Methods
Load(string, string?)
Parse the given file and return a single recording ready for replay.
public static BowireRecording Load(string path, string? select = null)
Parameters
pathstringAbsolute or relative path to a recording JSON file.
selectstringOptional recording name or id to disambiguate a store with multiple recordings.
Returns
NormalizeHttpRouting(BowireRecording)
Derive the HTTP routing pair (httpVerb + httpPath) for
steps whose protocol rides plain HTTP but whose recorder — or hand
author — left the fields empty. Both the matcher and the replayer
key on them, so without this a lean recording's GraphQL / SSE /
WebSocket / SignalR steps never match anything (#511) even though
the replayer supports all four. GraphQL posts to the serverUrl's
path; SSE subscriptions, WebSocket upgrades and SignalR connects
are GETs on the wire. gRPC (service/method + content-type match),
MQTT (broker transport host) and Socket.IO (upgrade-shape match)
have their own routing and stay untouched.
public static void NormalizeHttpRouting(BowireRecording recording)
Parameters
recordingBowireRecording
Parse(string, string?, string)
Same as Load(string, string?) but operates on an in-memory JSON string — used by tests and by the RecordingWatcher when a file change is detected.
public static BowireRecording Parse(string json, string? select = null, string sourceLabel = "<string>")