hapi-swagger
Advanced tools
Comparing version 10.0.2 to 10.1.0
@@ -237,2 +237,8 @@ import { Plugin } from '@hapi/hapi'; | ||
/** | ||
* Add hapi plugins option to internal hapi-swagger routes | ||
* @default [] | ||
*/ | ||
documentationRoutePlugins?: object; | ||
/** | ||
* The mime types consumed | ||
@@ -239,0 +245,0 @@ * |
@@ -219,2 +219,3 @@ const Hoek = require('@hapi/hoek'); | ||
'documentationPath', | ||
'documentationRoutePlugins', | ||
'documentationRouteTags', | ||
@@ -221,0 +222,0 @@ 'documentationPage', |
@@ -8,2 +8,3 @@ const { resolve } = require('path'); | ||
documentationRouteTags: [], | ||
documentationRoutePlugins: {}, | ||
templates: resolve(__dirname, '..', 'templates'), | ||
@@ -10,0 +11,0 @@ swaggerUIPath: '/swaggerui/', |
@@ -20,2 +20,3 @@ const Hoek = require('@hapi/hoek'); | ||
documentationRouteTags: Joi.alternatives().try(Joi.string(), Joi.array().items(Joi.string())), | ||
documentationRoutePlugins: Joi.object().default({}), | ||
templates: Joi.string(), | ||
@@ -147,3 +148,4 @@ swaggerUIPath: Joi.string(), | ||
return h.view('index', {}); | ||
} | ||
}, | ||
plugins: settings.documentationRoutePlugins | ||
} | ||
@@ -215,3 +217,4 @@ } | ||
return h.view('debug.html', {}).type('application/json'); | ||
} | ||
}, | ||
plugins: settings.documentationRoutePlugins | ||
} | ||
@@ -218,0 +221,0 @@ } |
@@ -114,3 +114,3 @@ const Hoek = require('@hapi/hoek'); | ||
if (allowDropdown && Array.isArray(describe.valids) && describe.valids.length) { | ||
// fliter out empty values and arrays | ||
// filter out empty values and arrays | ||
var enums = describe.valids.filter(item => { | ||
@@ -160,2 +160,7 @@ return item !== '' && item !== null; | ||
} | ||
const allowUnknown = joiObj._flags.allowUnknown; | ||
if (allowUnknown !== undefined && !allowUnknown) { | ||
property.additionalProperties = false; | ||
} | ||
} | ||
@@ -162,0 +167,0 @@ |
{ | ||
"name": "hapi-swagger", | ||
"description": "A swagger documentation UI generator plugin for hapi", | ||
"version": "10.0.2", | ||
"version": "10.1.0", | ||
"author": "Glenn Jones", | ||
@@ -30,2 +30,3 @@ "repository": { | ||
"start:debug": "node examples/debug.js", | ||
"start:jwt": "node examples/jwt.js", | ||
"start:dot:grouping": "node examples/dot-grouping.js", | ||
@@ -75,4 +76,4 @@ "start:extend": "node examples/extend.js", | ||
"coveralls": "^3.0.2", | ||
"eslint": "^5.15.1", | ||
"eslint-config-prettier": "^4.1.0", | ||
"eslint": "^6.0.1", | ||
"eslint-config-prettier": "^6.0.0", | ||
"good-squeeze": "^5.0.2", | ||
@@ -83,3 +84,3 @@ "hapi": "^18.0.0", | ||
"hapi-auth-jwt2": "^8.0.0", | ||
"husky": "^2.1.0", | ||
"husky": "^3.0.0", | ||
"js2xmlparser": "^4.0.0", | ||
@@ -90,3 +91,3 @@ "jsonwebtoken": "^8.1.1", | ||
"swagger-client": "^3.8.25", | ||
"tsd": "^0.7.3" | ||
"tsd": "^0.7.4" | ||
}, | ||
@@ -93,0 +94,0 @@ "peerDependencies": { |
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
101562
2878