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.9 to 4.9.0-beta.10

28

libV2/schemaUtils.js

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

},
PARAMTER_RESOLUTION_TYPE = {
SCHEMA: 'schema',
VALUE: 'value'
},
HEADER_TYPE_PREVIEW_LANGUAGE_MAP = {

@@ -206,3 +210,5 @@ [HEADER_TYPE.JSON]: 'json',

*/
resolveRefFromSchema = (context, $ref, stackDepth = 0, resolveFor = CONVERSION, seenRef = {}) => {
resolveRefFromSchema = (context, $ref, stackDepth = 0,
resolveFor = CONVERSION, seenRef = {}, resolveTo = PARAMTER_RESOLUTION_TYPE.SCHEMA
) => {
const { specComponents } = context;

@@ -251,7 +257,7 @@

if (!resolvedSchema) {
if (resolvedSchema === undefined) {
return { value: 'reference ' + $ref + ' not found in the OpenAPI spec' };
}
if (resolvedSchema.$ref) {
if (_.has(resolvedSchema, '$ref')) {
if (seenRef[resolvedSchema.$ref]) {

@@ -265,2 +271,6 @@ return {

if (resolveTo === PARAMTER_RESOLUTION_TYPE.VALUE) {
return resolvedSchema;
}
// eslint-disable-next-line no-use-before-define

@@ -528,2 +538,14 @@ resolvedSchema = resolveSchema(context, resolvedSchema, stackDepth, resolveFor, _.cloneDeep(seenRef));

// Resolve refs inside enums to value
if (schema.hasOwnProperty('enum')) {
_.forEach(schema.enum, (item, index) => {
if (item && item.hasOwnProperty('$ref')) {
schema.enum[index] = resolveRefFromSchema(
context, item.$ref, stack, resolveFor,
_.cloneDeep(seenRef), PARAMTER_RESOLUTION_TYPE.VALUE
);
}
});
}
return schema;

@@ -530,0 +552,0 @@ },

2

package.json
{
"name": "openapi-to-postmanv2",
"version": "4.9.0-beta.9",
"version": "4.9.0-beta.10",
"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