Class OpenApiExtensions

Namespace
Cratis.Arc.OpenApi
Assembly
Cratis.Arc.Core.dll

Provides extension methods for OpenAPI support.

public static class OpenApiExtensions
Inheritance
OpenApiExtensions
Inherited Members

Methods

MapOpenApi(ArcApplication, string, string, string)

Maps an OpenAPI endpoint that serves the OpenAPI specification document.

public static ArcApplication MapOpenApi(this ArcApplication app, string pattern = "/openapi.json", string title = "Arc Application", string version = "1.0.0")

Parameters

app ArcApplication

The ArcApplication to add the endpoint to.

pattern string

The route pattern for the OpenAPI document. Defaults to "/openapi.json".

title string

The title of the API. Defaults to "Arc Application".

version string

The version of the API. Defaults to "1.0.0".

Returns

ArcApplication

The ArcApplication for chaining.

Exceptions

InvalidOperationException

Thrown when the endpoint mapper is not HttpListenerEndpointMapper.