Socket
Socket
Sign inDemoInstall

openapi-to-postmanv2

Package Overview
Dependencies
87
Maintainers
9
Versions
168
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 4.15.0 to 4.16.0-beta.0

libV2/resolveComponents.js

29

lib/schemapack.js

@@ -711,2 +711,31 @@ 'use strict';

/**
* @param {Object} schema Schema to be resolved and faked
* @returns {Object} The faked value of the scehma provided
*/
resolveAndFakeSchema(schema) {
this.concreteUtils = concreteUtils;
this.specComponents = concreteUtils.getRequiredData(this.openapi);
let fakedValue;
try {
fakedValue = v2.resolveAndFakeSchema(this, schema);
}
catch (e) {
// console.log('Error while faking or resolving: ', e);
return {
result: false,
message: e.message,
error: e
};
}
return {
result: true,
value: fakedValue
};
}
static getOptions(mode, criteria) {

@@ -713,0 +742,0 @@ return getOptions(mode, criteria);

4

lib/xmlSchemaFaker.js

@@ -17,2 +17,6 @@ /* eslint-disable */

if (schema === null || typeof schema === 'undefined') {
return retVal;
}
const schemaExample = typeof schema === 'object' && (schema.example);

@@ -19,0 +23,0 @@

@@ -18,3 +18,3 @@ /* eslint-disable one-var */

const { resolvePostmanRequest } = require('./schemaUtils');
const { resolvePostmanRequest, resolveAndFakeSchema } = require('./schemaUtils');
const { generateRequestItemObject, fixPathVariablesInUrl } = require('./utils');

@@ -299,3 +299,9 @@

});
},
resolveAndFakeSchema(context, schema) {
context.schemaCache = context.schemaCache || {};
return resolveAndFakeSchema(context, schema);
}
};

@@ -790,2 +790,17 @@ const generateAuthForCollectionFromOpenAPI = require('./helpers/collection/generateAuthForCollectionFromOpenAPI');

/**
* Resolve a given ref from the schema
*
* @param {Object} context - Global context
* @param {Object} schema - Schema that is to be resolved
*
* @returns {Object} Faked data
*/
resolveAndFakeSchema = (context, schema) => {
const resolvedSchema = resolveSchema(context, schema),
fakedValue = fakeSchema(context, resolvedSchema);
return fakedValue;
},
/**
* Resolve value of a given parameter

@@ -1908,3 +1923,4 @@ *

resolveRefFromSchema,
resolveAndFakeSchema,
resolveSchema
};

@@ -17,2 +17,6 @@ /* eslint-disable */

if (schema === null || typeof schema === 'undefined') {
return retVal;
}
const schemaExample = typeof schema === 'object' && (schema.example);

@@ -19,0 +23,0 @@

2

package.json
{
"name": "openapi-to-postmanv2",
"version": "4.15.0",
"version": "4.16.0-beta.0",
"description": "Convert a given OpenAPI specification to Postman Collection v2.0",

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

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc