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

openapi-to-postmanv2

Package Overview
Dependencies
Maintainers
7
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openapi-to-postmanv2 - npm Package Compare versions

Comparing version 4.9.0-beta.34 to 4.9.0-beta.35

68

libV2/helpers/collection/generateSkeletionTreeFromOpenAPI.js

@@ -44,2 +44,11 @@ let _ = require('lodash'),

/**
* /user
* /team
* /hi
* /bye
*
* In this scenario, always create a base folder for the path
* and then add and link the request inside the created folder.
*/
if (pathSplit.length === 1) {

@@ -61,2 +70,16 @@ let methods = openapi.paths[completePath];

if (!tree.hasNode(`path:folder:${pathSplit[0]}`)) {
tree.setNode(`path:folder:${pathSplit[0]}`, {
type: 'folder',
meta: {
name: pathSplit[0],
path: pathSplit[0],
pathIdentifier: pathSplit[0]
},
data: {}
});
tree.setEdge('root:collection', `path:folder:${pathSplit[0]}`);
}
tree.setNode(`path:request:${pathSplit[0]}:${method}`, {

@@ -72,9 +95,3 @@ type: 'request',

if (tree.hasNode(`path:folder:${pathSplit[0]}`)) {
tree.setEdge(`path:folder:${pathSplit[0]}`, `path:request:${pathSplit[0]}:${method}`);
}
else {
tree.setEdge('root:collection', `path:request:${pathSplit[0]}:${method}`);
}
tree.setEdge(`path:folder:${pathSplit[0]}`, `path:request:${pathSplit[0]}:${method}`);
});

@@ -104,2 +121,24 @@ }

/**
* If it is the last node,
* it might happen that this exists as a folder.
*
* If yes add a request inside that folder else
* add as a request on the previous path idendified which will be a folder.
*/
if (!tree.hasNode(`path:folder:${pathIdentifier}`)) {
tree.setNode(`path:folder:${pathIdentifier}`, {
type: 'folder',
meta: {
name: path,
path: path,
pathIdentifier: pathIdentifier
},
data: {}
});
tree.setEdge(index === 0 ? 'root:collection' : `path:folder:${previousPathIdentified}`,
`path:folder:${pathIdentifier}`);
}
tree.setNode(`path:request:${pathIdentifier}:${method}`, {

@@ -115,16 +154,3 @@ type: 'request',

/**
* If it is the last node,
* it might happen that this exists as a folder.
*
* If yes add a request inside that folder else
* add as a request on the previous path idendified which will be a folder.
*/
if (tree.hasNode(`path:folder:${pathIdentifier}`)) {
tree.setEdge(`path:folder:${pathIdentifier}`, `path:request:${pathIdentifier}:${method}`);
}
else {
tree.setEdge(`path:folder:${previousPathIdentified}`, `path:request:${pathIdentifier}:${method}`);
}
tree.setEdge(`path:folder:${pathIdentifier}`, `path:request:${pathIdentifier}:${method}`);
});

@@ -131,0 +157,0 @@ }

{
"name": "openapi-to-postmanv2",
"version": "4.9.0-beta.34",
"version": "4.9.0-beta.35",
"description": "Convert a given OpenAPI specification to Postman Collection v2.0",

@@ -5,0 +5,0 @@ "homepage": "https://github.com/postmanlabs/openapi-to-postman",

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