Skip to content

Commit

Permalink
Merge branch 'release/1.1.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
umeshp7 committed Jun 12, 2020
2 parents 81998e9 + 4b25257 commit b339869
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# OpenAPI-Postman Changelog
#### v1.1.19 (June 12, 2020)
* Fix for [#232](https://github.com/postmanlabs/openapi-to-postman/issues/232) - Changes default auth of requests to null conforming to the JSON schema.

#### v1.1.18 (June 1, 2020)
* Fix for [#86](https://github.com/postmanlabs/openapi-to-postman/issues/86) - Now global security schemes will be added at the collection level.

Expand Down
4 changes: 2 additions & 2 deletions lib/schemaUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,9 +894,9 @@ module.exports = {

// return false if security set is not defined
// or is an empty array
// this will set the request's auth to default which is 'inherit from parent'
// this will set the request's auth to null - which is 'inherit from parent'
if (!securitySet || (Array.isArray(securitySet) && securitySet.length === 0)) {
return {};
return null;
}

securitySet.forEach((security) => {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openapi-to-postmanv2",
"version": "1.1.18",
"version": "1.1.19",
"description": "Convert a given OpenAPI specification to Postman Collection v2.0",
"homepage": "https://github.com/postmanlabs/openapi-to-postman",
"bugs": "https://github.com/postmanlabs/openapi-to-postman/issues",
Expand Down
6 changes: 5 additions & 1 deletion test/unit/base.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,15 @@ describe('CONVERT FUNCTION TESTS ', function() {

it('Should add collection level auth with type as `bearer`' +
securityTestCases, function(done) {
var openapi = fs.readFileSync(securityTestCases, 'utf8');
var openapi = fs.readFileSync(securityTestCases, 'utf8'),
auth;
Converter.convert({ type: 'string', data: openapi }, {}, (err, conversionResult) => {

auth = conversionResult.output[0].data.item[0].request.auth;

expect(err).to.be.null;
expect(conversionResult.result).to.equal(true);
expect(auth).to.be.null;
expect(conversionResult.output.length).to.equal(1);
expect(conversionResult.output[0].type).to.equal('collection');
expect(conversionResult.output[0].data).to.have.property('info');
Expand Down

0 comments on commit b339869

Please sign in to comment.