@imnotjames/koa-openapi-router
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Koa OpenAPI Router

Creates a Koa Router from an OpenAPI document via the OpenAPI Framework Package.

This sets up the routes, body parsing, request validation, response validation, security, and default parameters.

Installation

Install using npm or [yarn][yarn]

# npm
npm install @imnotjames/koa-openapi-router

# yarn
yarn add @imnotjames/koa-openapi-router

Getting Started

WIP

Start with an OpenAPI Document

Create Operations - similar to standard koa middleware

Define the application.

const app = new Koa();

const router = getRouter({ apiDoc, operations });

app
  .use(router.routes())
  .use(router.allowedMethods());

app.listen(8080);

Readme

Keywords

Package Sidebar

Install

npm i @imnotjames/koa-openapi-router

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

36.4 kB

Total Files

14

Last publish

Collaborators

  • imnotjames