Merge branch 'release/4.4.0'

This commit is contained in:
Vishal Shingala
2022-11-29 17:32:50 +05:30
6 changed files with 25 additions and 4 deletions

View File

@@ -4,4 +4,5 @@ node_js:
- "8"
- "10"
- "12"
- "lts/*"
- "14"
- "16"

View File

@@ -1,5 +1,9 @@
# OpenAPI-Postman Changelog
#### v4.4.0 (November 29, 2022)
* Fixed issue where collection folder name for paths were having extra spaces.
* Fixed issue where pipelines were failing for certain node version.
#### v4.3.0 (October 17, 2022)
* Fixed issue with nullable keywords getting validated incorrectly.

View File

@@ -990,7 +990,7 @@ module.exports = {
// only return a Postman folder if this folder has>1 children in its subtree
// otherwise we can end up with 10 levels of folders with 1 request in the end
itemGroup = new sdk.ItemGroup({
name: utils.insertSpacesInName(resource.name)
name: resource.name
// TODO: have to add auth here (but first, auth to be put into the openapi tree)
});
// If a folder has only one child which is a folder then we collapsed the child folder

View File

@@ -1,6 +1,6 @@
{
"name": "openapi-to-postmanv2",
"version": "4.3.0",
"version": "4.4.0",
"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",

View File

@@ -25,7 +25,7 @@ describe('travis.yml', function () {
describe('strucure', function () {
it('language must be set to node', function () {
expect(travisYAML.language).to.be('node_js');
expect(travisYAML.node_js).to.eql(['8', '10', '12', 'lts/*']);
expect(travisYAML.node_js).to.eql(['8', '10', '12', '14', '16']);
});
});
});

View File

@@ -1275,6 +1275,22 @@ describe('CONVERT FUNCTION TESTS ', function() {
done();
});
});
it('Should generate collection where folder name doesn\'t contain spaces when ' +
'not present in operation path', function (done) {
var openapi = fs.readFileSync(testSpec, 'utf8');
Converter.convert({ type: 'string', data: openapi }, { schemaFaker: true }, (err, conversionResult) => {
expect(err).to.be.null;
expect(conversionResult.result).to.equal(true);
expect(conversionResult.output.length).to.equal(1);
expect(conversionResult.output[0].type).to.equal('collection');
expect(conversionResult.output[0].data).to.have.property('info');
expect(conversionResult.output[0].data).to.have.property('item');
expect(conversionResult.output[0].data.item.length).to.equal(2);
expect(_.map(conversionResult.output[0].data.item, 'name')).to.include.members(['pets', 'pet/{petId}']);
done();
});
});
});
describe('Converting swagger 2.0 files', function() {