swagger-jsdoc
Advanced tools
Comparing version 6.2.1 to 6.2.2
{ | ||
"name": "swagger-jsdoc", | ||
"description": "Generates swagger doc based on JSDoc", | ||
"version": "6.2.1", | ||
"version": "6.2.2", | ||
"engines": { | ||
@@ -6,0 +6,0 @@ "node": ">=12.0.0" |
@@ -74,2 +74,24 @@ # swagger-jsdoc | ||
## Validation of swagger docs | ||
By default `swagger-jsdoc` tries to parse all docs to it's best capabilities. If you'd like to you can instruct an Error to be thrown instead if validation failed by setting the options flag `failOnErrors` to `true`. This is for instance useful if you want to verify that your swagger docs validate using a unit test. | ||
```javascript | ||
const swaggerJsdoc = require('swagger-jsdoc'); | ||
const options = { | ||
failOnErrors: true, // Whether or not to throw when parsing errors. Defaults to false. | ||
definition: { | ||
openapi: '3.0.0', | ||
info: { | ||
title: 'Hello World', | ||
version: '1.0.0', | ||
}, | ||
}, | ||
apis: ['./src/routes*.js'], | ||
}; | ||
const openapiSpecification = swaggerJsdoc(options); | ||
``` | ||
## Documentation | ||
@@ -76,0 +98,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72970
103