Class BowireRestProtocol
- Namespace
- Kuestenlogik.Bowire.Protocol.Rest
- Assembly
- Kuestenlogik.Bowire.Protocol.Rest.dll
Bowire protocol plugin for REST APIs. Discovers endpoints by fetching an OpenAPI 3 / Swagger document from the configured server URL, then exercises them via Kuestenlogik.Bowire.Protocol.Rest.RestInvoker. Auto-discovered by BowireProtocolRegistry.
public sealed class BowireRestProtocol : IBowireProtocol, IInlineHttpInvoker, IBowireDiscoveryDiagnostics, IDisposable
- Inheritance
-
BowireRestProtocol
- Implements
- Inherited Members
Constructors
BowireRestProtocol()
public BowireRestProtocol()
Properties
Description
One-line description shown next to the plugin's display name
in Settings → Plugins. Optional; defaults to empty so
the row falls back to "DisplayName + version" without the
description line. Keep it short (≤ 100 characters) — the row
truncates anything wider than the manage panel.
public string Description { get; }
Property Value
IconSvg
SVG icon for the protocol tab.
public string IconSvg { get; }
Property Value
Id
Short identifier (e.g., "grpc", "signalr").
public string Id { get; }
Property Value
Name
Protocol name shown in UI tabs.
public string Name { get; }
Property Value
Methods
DiscoverAsync(string, bool, CancellationToken)
Discover available services and methods.
public Task<List<BowireServiceInfo>> DiscoverAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)
Parameters
serverUrlstringshowInternalServicesboolctCancellationToken
Returns
DiscoverWithDiagnosticsAsync(string, bool, CancellationToken)
Discovery plus the sweep's own account of itself (#544). Everything this reports is what RestProbeLog already recorded — the difference is that core cannot read a plugin-local static ring buffer, so "no OpenAPI document found at http://localhost:5181" rendered in the diagnostics table as the generic "returned no services".
public Task<BowireDiscoveryReport> DiscoverWithDiagnosticsAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)
Parameters
serverUrlstringshowInternalServicesboolctCancellationToken
Returns
Remarks
The details lines are accumulated into a list allocated by
this call and threaded down as a parameter — never into a field.
That duplicates a handful of RestProbeLog writes on
purpose, and the duplication must stay: core must not read the
static (a process-global buffer keyed by nothing can hand URL A's
entry to URL B's probe, which is the exact bug this seam removes),
and the ring buffer keeps serving its own tests and UI.
Dispose()
Dispose the lazily-built HttpClient. The registry that owns the plugin instance disposes the plugin at host shutdown — same pattern as other long-lived HTTP-based protocol plugins.
public void Dispose()
Initialize(IServiceProvider?)
Called after registration to inject the app's service provider (embedded mode).
public void Initialize(IServiceProvider? serviceProvider)
Parameters
serviceProviderIServiceProvider
InvokeAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a unary or client-streaming call.
public Task<InvokeResult> InvokeAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
InvokeHttpAsync(string, BowireMethodInfo, List<string>, Dictionary<string, string>?, CancellationToken)
IInlineHttpInvoker implementation. Lets the BowireApi /api/invoke endpoint dispatch a generic BowireMethodInfo over HTTP — used by the gRPC plugin's transcoded methods so the same call can be tested via gRPC OR via HTTP. The method info is supplied inline by the JS layer; no cache lookup happens.
public Task<InvokeResult> InvokeHttpAsync(string serverUrl, BowireMethodInfo methodInfo, List<string> jsonMessages, Dictionary<string, string>? metadata, CancellationToken ct = default)
Parameters
serverUrlstringmethodInfoBowireMethodInfojsonMessagesList<string>metadataDictionary<string, string>ctCancellationToken
Returns
InvokeStreamAsync(string, string, string, List<string>, bool, Dictionary<string, string>?, CancellationToken)
Invoke a server-streaming or duplex call.
public IAsyncEnumerable<string> InvokeStreamAsync(string serverUrl, string service, string method, List<string> jsonMessages, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringjsonMessagesList<string>showInternalServicesboolmetadataDictionary<string, string>ctCancellationToken
Returns
OpenChannelAsync(string, string, string, bool, Dictionary<string, string>?, CancellationToken)
Open an interactive channel (for duplex/client-streaming).
public Task<IBowireChannel?> OpenChannelAsync(string serverUrl, string service, string method, bool showInternalServices, Dictionary<string, string>? metadata = null, CancellationToken ct = default)
Parameters
serverUrlstringservicestringmethodstringshowInternalServicesboolmetadataDictionary<string, string>ctCancellationToken