UNPKG

koas-spec-handler

Version:

Koas spec handler exposes the Open API document as a JSON API call.

24 lines (23 loc) 611 B
import { Plugin } from 'koas-core'; declare module 'koas-core' { interface OpenAPIContext { /** * The URL on which the OpenAPI document is served. */ specURL?: string; } } interface SpecHandlerOptions { /** * The URL on which to serve the OpenAPI document. */ url?: string; } /** * Serve the Koas OpenAPI document as JSON. * * @param options - Options to configure how the OpenAPI document is served. * @returns A Koas plugin to serve the OpenAPI document. */ export declare function specHandler({ url }?: SpecHandlerOptions): Plugin; export {};