0.0.2 • Published 4 years ago

@imnotjames/koa-openapi-router v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

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

# 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);