Gathering detailed insights and metrics for koa-joi-router-docs-v2
Gathering detailed insights and metrics for koa-joi-router-docs-v2
A Swagger API Docs generator from koa-joi-router routes.
npm install koa-joi-router-docs-v2
Typescript
Module System
Node Version
NPM Version
71.9
Supply Chain
96.4
Quality
78.4
Maintenance
100
Vulnerability
98.6
License
JavaScript (100%)
Total Downloads
69,575
Last Day
97
Last Week
339
Last Month
1,358
Last Year
22,968
3 Stars
97 Commits
3 Forks
1 Watching
5 Branches
7 Contributors
Minified
Minified + Gzipped
Latest Version
1.5.4
Package Id
koa-joi-router-docs-v2@1.5.4
Unpacked Size
39.43 kB
Size
10.83 kB
File Count
16
NPM Version
10.2.4
Node Version
21.6.2
Publised On
13 Sept 2024
Cumulative downloads
Total Downloads
Last day
54%
97
Compared to previous day
Last week
5.9%
339
Compared to previous week
Last month
-7.9%
1,358
Compared to previous month
Last year
-48.8%
22,968
Compared to previous year
3
3
This project is based on https://github.com/chuyik/koa-joi-router-docs which does not support latest Joi version.
This project uses latest koa-joi-router
package. Also this package uses joi-to-swagger
.
Also we can rename keys, like nullable
to be x-nullable
. For example for redoc
Example:
1 const spec = generator.generateSpec({ 2 info: { 3 title: 'Example API', 4 version: '1.1' 5 }, 6 basePath: '/' 7 }, undefined, { 'nullable': 'x-nullable' });
No additional action required, it should be possible just to replace older package.
A node module for generating Swagger 2.0 JSON definitions from existing koa-joi-router routes.
1# use npm 2npm install koa-joi-router-docs-v2 --save 3# use yarn 4yarn add koa-joi-router-docs-v2
Visit example/ folder to see the full example.
Creates a new SwaggerAPI instance.
Add a joi-router instance to the API. The router should already have all its
routes set up before calling this method (which pulls the route definitions
from the router's .routes
property).
Options:
Create a Swagger specification for this API. A base specification should be
provided with an info
object (containing at least the title
and version
strings) and any other global descriptions.
baseSpec
example:
1{ 2 info: { 3 title: 'Example API', 4 version: '1.1' 5 }, 6 basePath: '/' 7}
options
example:
1 { 2 200: { 3 description: 'Success' 4 } 5 }
renameKeys
example:
1 { 'nullable': 'x-nullable' }
No vulnerabilities found.
No security vulnerabilities found.