Class OpenApiDiscovery
- Namespace
- Kuestenlogik.Bowire.Protocol.Rest.OpenApi2
- Assembly
- Kuestenlogik.Bowire.Protocol.Rest.OpenApi2.dll
Discovers REST endpoints by fetching an OpenAPI 3 document from the user's URL and converting it into Bowire's service/method/field model so the existing form-based UI can render REST calls without any REST-specific knowledge.
Built against Microsoft.OpenApi v2 (preview), which supports both OpenAPI
3.0 and 3.1. The 3.1 type system uses a flags enum (JsonSchemaType)
instead of strings, and example/default values are JsonNode
instances rather than the v1 IOpenApiAny wrapper.
public static class OpenApiDiscovery
- Inheritance
-
OpenApiDiscovery
- Inherited Members
Methods
BuildServices(OpenApiDocument)
Convert a parsed OpenAPI document into Bowire services. Operations are grouped by their first tag (Postman-style). Operations without tags go into a "Default" service so they're not lost.
public static List<BowireServiceInfo> BuildServices(OpenApiDocument doc)
Parameters
docOpenApiDocument
Returns
FetchAndParseAsync(string, HttpClient, CancellationToken)
Fetch the OpenAPI document from the EXACT URL the user provided.
No path probing — the URL is taken literally. The plugin's
DiscoverAsync handles the wrong-protocol case by silently
returning no services so other plugins (gRPC, SignalR, ...) can
succeed against the same URL.
public static Task<DiscoveredApi?> FetchAndParseAsync(string docUrl, HttpClient http, CancellationToken ct)
Parameters
docUrlstringhttpHttpClientctCancellationToken
Returns
GetFirstServerUrl(OpenApiDocument)
Returns the first server URL declared in the OpenAPI document, if any. Used to override the discovery URL with the actual API base when the OpenAPI doc is hosted somewhere different from where the API runs.
public static string? GetFirstServerUrl(OpenApiDocument doc)
Parameters
docOpenApiDocument
Returns
ParseRawAsync(string, CancellationToken)
Parses raw OpenAPI/Swagger document text (JSON or YAML) without any HTTP fetch. Used for documents uploaded via OpenApiUploadStore.
public static Task<DiscoveredApi?> ParseRawAsync(string content, CancellationToken ct)
Parameters
contentstringctCancellationToken