Table of Contents

Class RDWebOpenApi

Namespace
RDCore.Web.Hosting
Assembly
RDCore.Web.dll

The OpenAPI 3.1 document of an RD-VBA application: an operation for each endpoint, its parameters and its body described by the JSON Schemas of the procedure's parameters, and its responses by the schema of its value and by the problem details the host answers with.

public static class RDWebOpenApi
Inheritance
RDWebOpenApi
Inherited Members

Fields

DocumentPath

The path the host serves the document at.

public const string DocumentPath = "/openapi/v1.json"

Field Value

string

SchemaPrefix

What a reference to one of the document's schemas is, before its name: the schemas of the classes of the workspace are its components.

public const string SchemaPrefix = "#/components/schemas/"

Field Value

string

Methods

DocumentOf(string, IReadOnlyList<RDWebEndpoint>, ProgramJsonSchemas?, bool)

The document of the endpoints.

public static JsonObject DocumentOf(string title, IReadOnlyList<RDWebEndpoint> endpoints, ProgramJsonSchemas? schemas, bool dispatched)

Parameters

title string

The title of the document: the application's name.

endpoints IReadOnlyList<RDWebEndpoint>

The endpoints, in the order the host maps them.

schemas ProgramJsonSchemas

The JSON Schemas of the program's procedures, references to definitions written with SchemaPrefix (JsonSchemasAsync(string, CancellationToken)); null for a program that does not state them, whose operations have no schemas, and whose parameters are all required.

dispatched bool

Whether the host dispatches each request (Program.Run, services, filters), which answers a Function declared As RDWeb.Result with the result's status and body (ReturnsResult).

Returns

JsonObject

The document. Each endpoint is an operation of its route's path, named Module_Procedure, followed by its method when another operation has the name, tagged with its module, and summarized by its procedure's description; each module's tag is described by the module's. A route parameter is a path parameter, and any other parameter the request binds a query parameter, required unless it is Optional. A POST's body parameter is its request body and a query parameter, required in neither: a request without a body binds it from the query string. Its components are the schemas the operations refer to.