Naughty Program Manipulator
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

joi-openapi-generator

1.0.1 • Public • Published

OpenAPI generator

This is a tool for generating OpenAPI schemas from koa-joi-router definitions. It is compatible with @hapi/joi 16.x.x.

Usage

You can create koa-joi-router as usual and provide some metadata in route definitions.

Router meta options:

  • name: string - name of the route (will be used as operationId)
  • group?: string
  • version
  • tags
    • assigned tags to the route can be matched during the build
    • tags with prefix openapi- will be included in tags property in the operation object
    • reserved tags: ignore-route

Moreover you can provide some meta options in Joi validation schemas.

Joi meta options:

  • name: string - when set the type will be extracted and exported with this name
  • deprecated: boolean

Generator also supports many Joi native features, such as examples, description, key presence or various flags.

Keywords

none

Install

npm i joi-openapi-generator

DownloadsWeekly Downloads

16

Version

1.0.1

License

ISC

Unpacked Size

273 kB

Total Files

33

Last publish

Collaborators

  • avatar