@sigodenjs/openapize
TypeScript icon, indicating that this package has built-in type declarations

0.1.14 • Public • Published

Openapize

Mount rest api depends on OpenAPI doc file for express app.

Getting started

const openapize = require("@sigodenjs/openapize");
const express = require("express");
const bodyParser = require("body-parser");

const app = express();

app.use(bodyParser.json());

openapize(app, {
  // openapi file
  api: require("./fixtures/defs/pets.json"),
  // handler funcs
  handlers: require("./handlers"),
  // security middleware funcs
  security: require("./security"),
  // hook to modify api
  mapAPI: function(api) {
    return api;
  },
  // no handler for api
  noHandlerAPI: function(api) {

  }
});

Limit

  • ParameterObject does not support content
  • RequestBodyObject.content has at most one MeidaObject
  • OperationObject.security has at most one securitySchemes

Licese

Copyright (c) 2018 sigoden

Licensed under the MIT license.

Readme

Keywords

Package Sidebar

Install

npm i @sigodenjs/openapize

Weekly Downloads

0

Version

0.1.14

License

MIT

Unpacked Size

33.5 kB

Total Files

18

Last publish

Collaborators

  • sigoden