Socket
Socket
Sign inDemoInstall

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

29

libV2/schemaUtils.js

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

else if (concreteUtils.compareTypes(schema.type, SCHEMA_TYPES.array) && schema.items) {
// Add maxItem and minItem defintion since we want to enforce a limit on the number
// of items being faked by schema faker
/*
For VALIDATION - keep minItems and maxItems properties defined by user in schema as is
FOR CONVERSION -
Json schema faker fakes exactly maxItems # of elements in array
Hence keeping maxItems as minimum and valid as possible for schema faking (to lessen faked items)
We have enforced limit to maxItems as 100, set by Json schema faker option
*/
if (resolveFor === 'CONVERSION') {
// Override minItems to default (2) if no minItems present
if (!_.has(schema, 'minItems') && _.has(schema, 'maxItems') && schema.maxItems >= 2) {
schema.minItems = 2;
}
if (!_.has(schema, 'minItems') && _.has(schema, 'maxItems') && schema.maxItems >= 2) {
schema.minItems = 2;
}
// Override maxItems to minItems if minItems is available
if (_.has(schema, 'minItems') && schema.minItems > 0) {
schema.maxItems = schema.minItems;
}
// Override maxItems to minItems if minItems is available
if (_.has(schema, 'minItems') && schema.minItems > 0) {
schema.maxItems = schema.minItems;
// If no maxItems is defined than override with default (2)
!_.has(schema, 'maxItems') && (schema.maxItems = 2);
}
// If no maxItems is defined than override with default (2)
!_.has(schema, 'maxItems') && (schema.maxItems = 2);
schema.items = resolveSchema(context, schema.items, stack, resolveFor, _.cloneDeep(seenRef));

@@ -422,0 +429,0 @@ }

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