Class ProtoDocumentSource
Loads a text document from inline content, a local file, or an HTTP(S) URL.
public static class ProtoDocumentSource
- Inheritance
-
ProtoDocumentSource
- Inherited Members
Methods
IsApplicationPath(string, string?)
Whether source is a path the application serves (/openapi/v1.json) with
no base address to resolve it against and no file by that name. Such a document loads from the
application once the run can reach it, through LoadTextAsync(string, HttpClient, CancellationToken).
public static bool IsApplicationPath(string source, string? baseUrl = null)
Parameters
Returns
LoadText(string, string?, HttpClient?, params string[])
Loads a text document from inline content, a local file, or an HTTP(S) URL.
public static string LoadText(string source, string? baseUrl = null, HttpClient? httpClient = null, params string[] inlinePrefixes)
Parameters
sourcestringAn inline document, a local file path, or an absolute or relative URL.
baseUrlstringThe origin a relative URL resolves against, when one is configured.
httpClientHttpClientThe client to retrieve a URL with; the shared one is used when omitted.
inlinePrefixesstring[]The document-format prefixes the calling integration recognizes - an SDL document starts with
type, an OpenAPI document withopenapi:. Core knows only that a multi-line body or a JSON object/array is inline, so each format's vocabulary stays with that format.
Returns
LoadTextAsync(string, HttpClient, CancellationToken)
Loads a document from an application's client, relative to the client's base address.
public static Task<string> LoadTextAsync(string source, HttpClient client, CancellationToken cancellationToken = default)
Parameters
sourcestringclientHttpClientcancellationTokenCancellationToken