Socket
Socket
Sign inDemoInstall

ibm-openapi-support

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ibm-openapi-support - npm Package Compare versions

Comparing version 0.0.11 to 0.0.12

13

index.js

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

let resourceFormatter = formatters['resourceFormatter'] || function (route) { return route }
let typeFormatter = formatters['typeFormatter'] || function (type) { return type }

@@ -201,2 +202,3 @@ Object.keys(api.paths).forEach(function (path) {

let params = []
let idtype
// process the parameters

@@ -223,2 +225,11 @@ if (api.paths[path][verb].parameters) {

}
// if there is a trailing id on the path, get its type from the parameters
// section.
let id = genutil.getIdName(path)
if (id && parameter.in && parameter.in == 'path') {
if (id === parameter.name) {
idtype = typeFormatter(parameter.type)
}
}
})

@@ -259,3 +270,3 @@ }

// save the method, the path and associated parameters in the resources list.
resources[resource].push({method: verb, route: pathFormatter(path), params: params, responses: resp})
resources[resource].push({method: verb, route: pathFormatter(path), params: params, responses: resp, idtype: idtype})
}

@@ -262,0 +273,0 @@ })

2

package.json
{
"name": "ibm-openapi-support",
"version": "0.0.11",
"version": "0.0.12",
"description": "utility for loading and parsing swagger",

@@ -5,0 +5,0 @@ "author": {

@@ -36,2 +36,13 @@ /*

exports.getIdName = function (ref) {
// get the id name from the end of the path, if it exists.
let name = ref.split('{').pop()
if (name.endsWith('}')) {
name = name.split('}')[0]
} else {
name = undefined
}
return name
}
exports.arrayContains = function (search, array) {

@@ -38,0 +49,0 @@ // return true/false if search is/not found in array.

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