Class KoaOasRouter<StateT, CustomT>

A child class of the koa-router. It extends the koa-router by some features that can be used with oas.

KoaOasRouter

Type Parameters

  • StateT = any
  • CustomT = {}

Hierarchy

  • Router
    • KoaOasRouter

Constructors

Methods

  • Adds the routes from a specification to the router. As implementation it uses the controllers from the opts.controllerBasePath (default = '../controller'). The name of the controller file is the first tag of a operation in pascal case. The name of the function in the controller file is the operationId. The specification will be validated by oas-validator. You can opt this out with opts.validateSpecification. If a implementation is not found this function will add a stub for that. You can opt this out with opts.provideStubs.

    Parameters

    Returns Promise<any>

    KoaOasRouter