diff --git a/CHANGELOG.md b/CHANGELOG.md index 6bdcf9e..94c8a16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.4.1-beta-2] - 2026-07-02 + +### Fixed +- Fix `index.js` requiring the removed `openapiAuthorizationDefinition.js` path. +- Fix missing `JSON.parse` when reading the response schema from the environment variable. + ## [2.4.1-beta-1] - 2026-06-26 ### Fixed diff --git a/index.js b/index.js index 203cf6c..5bb1cc2 100644 --- a/index.js +++ b/index.js @@ -233,7 +233,7 @@ _.forEach(environments, function (element) { if ( element.custom_authorizations_file ) { require('./src/parser/authorizationRequests.js')(endpointsStage,element.custom_authorizations_file) } else if(globalThis.definition.components?.securitySchemes){ - let securityDefinition = require('./src/parser/openapiAuthorizationDefinition.js')(globalThis.definition.components.securitySchemes) + let securityDefinition = require('./src/parser/openapi3/authorizationDefinition.js')(globalThis.definition.components.securitySchemes) if(securityDefinition){ require('./src/parser/authorizationRequests.js')(endpointsStage,null,securityDefinition) } diff --git a/package-lock.json b/package-lock.json index e8dffa3..50f7806 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "openapi2postman", - "version": "2.4.1-beta-1", + "version": "2.4.1-beta.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "openapi2postman", - "version": "2.4.1-beta-1", + "version": "2.4.1-beta.2", "license": "ISC", "dependencies": { "js-yaml": "^4.1.0", diff --git a/package.json b/package.json index 5b27965..140fc58 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "openapi2postman", - "version": "2.4.1-beta.1", + "version": "2.4.1-beta.2", "description": "openapi2postman", "bin": { "o2p": "index.js" diff --git a/src/generator/environmentVariablesNames.js b/src/generator/environmentVariablesNames.js index c4337c0..1360dd3 100644 --- a/src/generator/environmentVariablesNames.js +++ b/src/generator/environmentVariablesNames.js @@ -143,8 +143,8 @@ module.exports = function() { if (!aux.bodyResponse?.[aux.status]) return; const key = numerateItem + 'schemaTest'; for (let i in execCode){ - if (execCode[i] === 'var schema = pm.environment.get("schemaTest");'){ - execCode[i] = 'var schema = pm.environment.get("' + key + '");'; + if (execCode[i] === 'var schema = JSON.parse(pm.environment.get("schemaTest"));'){ + execCode[i] = 'var schema = JSON.parse(pm.environment.get("' + key + '"));'; } } let schemaJSON = configurationFile.schema_pretty_print === true diff --git a/src/generator/testBody.js b/src/generator/testBody.js index 26133b0..88768eb 100644 --- a/src/generator/testBody.js +++ b/src/generator/testBody.js @@ -22,7 +22,7 @@ module.exports = function() { let schemaJSON; if (configurationFile.schema_is_inline === false) { - schemaJSON = 'pm.environment.get("schemaTest")'; + schemaJSON = 'JSON.parse(pm.environment.get("schemaTest"))'; } else { schemaJSON = configurationFile.schema_pretty_print === true ? JSON.stringify(postmanRequest.aux.bodyResponse[postmanRequest.aux.status], null, 4)