Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hapi-swagger

Package Overview
Dependencies
Maintainers
2
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hapi-swagger - npm Package Compare versions

Comparing version 14.1.1 to 14.1.2

27

lib/parameters.js

@@ -36,2 +36,4 @@ const Hoek = require('@hapi/hoek');

parameters.itemsObjectProperties = ['type', 'format', 'items', 'collectionFormat', 'default', 'maximum', 'exclusiveMaximum', 'minimum', 'exclusiveMinimum', 'maxLength', 'minLength', 'pattern', 'maxItems', 'minItems', 'uniqueItems', 'enum', 'multipleOf'];
/**

@@ -96,2 +98,3 @@ * takes a swagger schema object and returns a parameters object

// reinstate required at parameter level
delete item.required;
if (schemaObj.required && (schemaObj.properties[key].required || schemaObj.required.indexOf(key) > -1)) {

@@ -104,3 +107,6 @@ item.required = true;

item = Utilities.removeProps(item, this.allowedProps);
// object is not a valid parameter type in v2.0, replacing it with string
this.replaceObjectsWithStrings(item);
item = this.removePropsRecursively(item);
out.push(item);

@@ -111,1 +117,20 @@ });

};
parameters.replaceObjectsWithStrings = function (item) {
if(item.type === 'object'){
item.type = 'string';
item['x-type'] = 'object';
Utilities.findAndRenameKey(item, 'properties', 'x-properties')
}
if(item.items){ // repeat for array items
this.replaceObjectsWithStrings(item.items);
}
}
parameters.removePropsRecursively = function (item, props=this.allowedProps){
item = Utilities.removeProps(item, props);
if(item.items){ // repeat for array items
this.removePropsRecursively(item.items, this.itemsObjectProperties)
}
return item;
}

2

lib/properties.js

@@ -169,3 +169,2 @@ const Hoek = require('@hapi/hoek');

}
property.name = name;
property.properties = {

@@ -438,3 +437,2 @@ [patternName]: this.parseProperty(

});
property.name = name;
return property;

@@ -441,0 +439,0 @@ };

{
"name": "hapi-swagger",
"description": "A swagger documentation UI generator plugin for hapi",
"version": "14.1.1",
"version": "14.1.2",
"author": "Glenn Jones",

@@ -56,3 +56,3 @@ "repository": {

"swagger-parser": "4.0.2",
"swagger-ui-dist": "^3.22.1"
"swagger-ui-dist": "^3.47.1"
},

@@ -62,5 +62,5 @@ "devDependencies": {

"@hapi/code": "^8.0.1",
"@hapi/good": "^8.2.3",
"@hapi/good-console": "^8.1.2",
"@hapi/h2o2": "^8.2.0",
"@hapi/good": "^9.0.1",
"@hapi/good-console": "^9.0.1",
"@hapi/h2o2": "^9.0.2",
"@hapi/hapi": "^20.0.0",

@@ -71,13 +71,13 @@ "@hapi/inert": "^6.0.1",

"@hapi/wreck": "^17.0.0",
"@types/hapi__hapi": "^18.2.6",
"@types/hapi__hapi": "^20.0.7",
"babel-eslint": "^10.0.3",
"blipp": "^4.0.0",
"chalk": "^2.3.1",
"chalk": "^4.1.0",
"coveralls": "^3.0.2",
"eslint": "^6.4.0",
"eslint-config-prettier": "^6.0.0",
"eslint": "^7.24.0",
"eslint-config-prettier": "^8.2.0",
"good-squeeze": "^5.0.2",
"hapi-api-version": "^2.1.0",
"hapi-auth-bearer-token": "^6.1.1",
"hapi-auth-jwt2": "^8.0.0",
"hapi-auth-bearer-token": "^8.0.0",
"hapi-auth-jwt2": "^10.2.0",
"husky": "^3.0.0",

@@ -87,6 +87,6 @@ "joi": "^17.2.0",

"jsonwebtoken": "^8.1.1",
"lint-staged": "^9.4.0",
"prettier": "^1.16.4",
"lint-staged": "^10.5.4",
"prettier": "^2.2.1",
"swagger-client": "^3.9.4",
"tsd": "^0.7.4"
"tsd": "^0.14.0"
},

@@ -93,0 +93,0 @@ "peerDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc