UNPKG

azure-functions-swagger-ui

Version:

A simple npm module that integrates Swagger UI into Azure Functions, providing a user-friendly interface to visualize and interact with your API endpoints. Perfect for documenting and testing Azure Functions with minimal setup.

20 lines (17 loc) 1.31 kB
import { HttpFunctionOptions } from "@azure/functions"; import swagger_ui_handler from './src/handler'; import { SwaggerOptions } from "./src/makeHtml"; /** * * @param name The name of the function. This will be the route unless a route is explicitly configured in the `HttpTriggerOptions`, default is 'swagger_ui' * @param swaggerOptions SwaggerOptions, { doc_path, title?, favicon16?, favicon32?, css_path?, display_topbar? : 0 | 1 | 2 | 3} * @param httpFunctionOptions HttpFunctionOptions, azure function options * @param is_swagger_jsdoc_object boolean | Array<boolean>, set to true if the doc_path is a swagger-jsdoc object or boolean array of the same length as doc_path specifying which doc_path is a swagger-jsdoc object * * This function creates a new http function with the specified name and options. * * Set options.route to the route where you want to access the Swagger UI without parameters. For example: 'apidocs', and '/{file?}' will be added automatically. * https://github.com/Le-Roi-du-village/azure-functions-swagger-ui#other-example */ export default function (name: string | undefined, swaggerOptions: SwaggerOptions, httpFunctionOptions?: Partial<HttpFunctionOptions>, is_swagger_jsdoc_object?: boolean | Array<boolean>): void; export { swagger_ui_handler, SwaggerOptions };