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

swagger-tools

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

swagger-tools - npm Package Compare versions

Comparing version 0.4.5 to 0.4.6

2

index.js

@@ -902,2 +902,2 @@ /*

var v1_2 = module.exports.v1_2 = new Specification('1.2'); // jshint ignore:line
module.exports.v1_2 = new Specification('1.2'); // jshint ignore:line

@@ -23,5 +23,22 @@ /*

var expressStylePath = function expressStylePath (api) {
// Since all path parameters must be required, no need to do any fancy parsing
return (api.path || '').replace(/{/g, ':').replace(/}/g, '');
var expressStylePath = function expressStylePath (basePath, apiPath) {
basePath = parseurl({url: basePath || '/'}).pathname || '/';
// Make sure the base path starts with '/'
if (basePath.charAt(0) !== '/') {
basePath = '/' + basePath;
}
// Make sure the base path ends with '/'
if (basePath.charAt(basePath.length - 1) !== '/') {
basePath = basePath + '/';
}
// Make sure the api path does not start with '/' since the base path will end with '/'
if (apiPath.charAt(0) === '/') {
apiPath = apiPath.substring(1);
}
// Replace Swagger syntax for path parameters with Express' version (All Swagger path parameters are required)
return (basePath + apiPath).replace(/{/g, ':').replace(/}/g, '');
};

@@ -69,3 +86,3 @@

var keys = [];
var re = pathToRegexp(expressStylePath(api), keys);
var re = pathToRegexp(expressStylePath(resource.basePath, api.path), keys);
var reStr = re.toString();

@@ -72,0 +89,0 @@

@@ -24,3 +24,2 @@ /*

var dateTimeRegExp = /^([0-9]{2}):([0-9]{2}):([0-9]{2})(.[0-9]+)?(z|([+-][0-9]{2}:[0-9]{2}))$/;
var spec = require('../').v1_2; // jshint ignore:line

@@ -27,0 +26,0 @@ var isValid = function isValid (val, type, format) {

{
"name": "swagger-tools",
"version": "0.4.5",
"version": "0.4.6",
"description": "Various tools for using and integrating with Swagger.",

@@ -5,0 +5,0 @@ "main": "index.js",

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