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
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
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
titlestringThe title of the document: the application's name.
endpointsIReadOnlyList<RDWebEndpoint>The endpoints, in the order the host maps them.
schemasProgramJsonSchemasThe 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.
dispatchedboolWhether the host dispatches each request (Program.Run, services, filters), which answers a
FunctiondeclaredAs RDWeb.Resultwith 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 apathparameter, and any other parameter the request binds aqueryparameter, required unless it isOptional. APOST'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.