mirror of
https://github.com/postmanlabs/openapi-to-postman.git
synced 2022-11-29 22:05:00 +03:00
Merge pull request #644 from postmanlabs/feature/fix-request-name-path-spaces
Fixed issue where collection folder name for paths were having extra spaces.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user