openapi-to-postmanv2
Advanced tools
Comparing version 4.9.0-beta.36 to 4.9.0-beta.37
# OpenAPI-Postman Changelog | ||
#### v4.10.0 (March 08, 2023) | ||
* Added support for convertV2() interface which has more stacklimit for schema resolution. | ||
* Added support for validateTransactionV2() interface uses same v2 interface for resolving schema. | ||
* Fixed multiple issues for urlencoded body with anyOf and oneOf schemas where valid data was reported as mismatches. | ||
#### v4.9.0 (February 06, 2023) | ||
@@ -4,0 +9,0 @@ * Fixed issue [#660](https://github.com/postmanlabs/openapi-to-postman/issues/660) where for certain XML request bodies, conversion was failing with TypeError. |
@@ -435,3 +435,3 @@ const _ = require('lodash'), | ||
if (schema.hasOwnProperty('type')) { | ||
// Override default value to schema for CONVERSION only for parmeter resolution set to schema | ||
// Override default value to schema for CONVERSION only for parameter resolution set to schema | ||
if (resolveFor === 'CONVERSION' && resolveTo === 'schema') { | ||
@@ -456,6 +456,23 @@ if (!schema.hasOwnProperty('format')) { | ||
else if (schema.enum && schema.enum.length > 0) { | ||
return { | ||
type: (typeof (schema.enum[0])), | ||
value: schema.enum[0] | ||
}; | ||
if (resolveFor === 'CONVERSION' && resolveTo === 'schema') { | ||
schema.type = (typeof (schema.enum[0])); | ||
if (!schema.hasOwnProperty('format')) { | ||
schema.default = '<' + schema.type + '>'; | ||
} | ||
else if (typesMap.hasOwnProperty(schema.type)) { | ||
schema.default = typesMap[schema.type][schema.format]; | ||
if (!schema.default && schema.format) { | ||
schema.default = '<' + schema.format + '>'; | ||
} | ||
} | ||
else { | ||
schema.default = '<' + schema.type + (schema.format ? ('-' + schema.format) : '') + '>'; | ||
} | ||
} | ||
else { | ||
return { | ||
type: (typeof (schema.enum[0])), | ||
value: schema.enum[0] | ||
}; | ||
} | ||
} | ||
@@ -462,0 +479,0 @@ else if (isAllOf) { |
@@ -382,3 +382,8 @@ const { filterOptionsByVersion } = require('./common/versionUtils'); | ||
if (_.isObject(criteria)) { | ||
typeof criteria.external === 'boolean' && (optsArray = _.filter(optsArray, { external: criteria.external })); | ||
const externalDefault = typeof criteria.external === 'boolean' ? criteria.external : true, | ||
usageDefault = ['CONVERSION']; | ||
typeof criteria.external === 'boolean' && (optsArray = _.filter(optsArray, { external: externalDefault })); | ||
(!_.isArray(criteria.usage) || _.isEmpty(criteria.usage)) && (criteria.usage = usageDefault); | ||
if (_.isArray(criteria.usage)) { | ||
@@ -385,0 +390,0 @@ let tempOptsArray = []; |
@@ -1515,2 +1515,5 @@ const generateAuthForCollectionFromOpenAPI = require('./helpers/collection/generateAuthForCollectionFromOpenAPI'); | ||
// Request name should be max 256 characters so trim if needed. | ||
reqName = utils.trimRequestName(reqName); | ||
return reqName; | ||
@@ -1517,0 +1520,0 @@ }, |
{ | ||
"name": "openapi-to-postmanv2", | ||
"version": "4.9.0-beta.36", | ||
"version": "4.9.0-beta.37", | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1709816
43861
3