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
appArcApplicationThe ArcApplication to add the endpoint to.
patternstringThe route pattern for the OpenAPI document. Defaults to "/openapi.json".
titlestringThe title of the API. Defaults to "Arc Application".
versionstringThe 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.