@simply-openapi/controllers
TypeScript icon, indicating that this package has built-in type declarations

1.7.8 • Public • Published

Simply OpenAPI Controllers

Read our documentation more easily on GitBook!

Simply OpenAPI Controllers is an ExpressJS compatible OpenAPI-First controller library. It produces fully robust method handlers on controllers by consuming an OpenAPI 3.1 specification and calling your handlers with all data pre-validated and coerced according to your specification.

It exposes its handlers as a single express middleware / router, allowing integration with express itself or with any library or framework that wraps it.

Don't have OpenAPI specs? No problem! SOC also provides decorators for your classes and methods that will create the openapi spec for you according to your handler usage and declaration.

SOC is designed to be a single-purpose library. It solves the use case of producing robust controllers and methods for web request handling, and does not dictate any design patterns beyond what it needs to do its job.
It is highly extensible, supporting both the typical express middleware, plus its own middleware for method handlers, allowing you to integrate with the method creation for customizing both the inputs and outputs of your controller methods.

At its heart, this library provides two complementary systems:

  • The ability to take decorated classes and methods, and produce robust complete OpenAPI specifications from them
  • The ability to take OpenAPI specifications and wire them up to handlers, with all the boilerplate validation taken care of automatically.

Usage

There are 2 ways to use SOC:

Package Sidebar

Install

npm i @simply-openapi/controllers

Weekly Downloads

5

Version

1.7.8

License

MIT

Unpacked Size

266 kB

Total Files

260

Last publish

Collaborators

  • sunsetfi