UNPKG

@apvee/azure-functions-openapi

Version:

An extension for Azure Functions V4 that provides support for exporting OpenAPI spec files from annotated Azure Functions.

13 lines (12 loc) 912 B
import { OpenAPIDocumentInfo } from "../core/types"; /** * Registers a Swagger UI handler for an Azure Function. * * @param {'anonymous' | 'function' | 'admin'} authLevel - The authorization level required to access the Swagger UI. * @param {string} azureFunctionRoutePrefix - The route prefix for the Azure Function. Defaults to 'api'. * @param {OpenAPIDocumentInfo[]} openAPIDocuments - An array of OpenAPI document information objects to be included in the Swagger UI. * * This function sets up an HTTP GET handler that serves a Swagger UI page, which lists the provided OpenAPI documents. * The Swagger UI is configured to use the provided URLs and titles for the OpenAPI documents. */ export declare function registerSwaggerUIHandler(authLevel: ("anonymous" | "function" | "admin") | undefined, azureFunctionRoutePrefix: (string | null) | undefined, openAPIDocuments: OpenAPIDocumentInfo[]): void;