Add default version to response

Add default version to response
This commit is contained in:
Luis Tejeda
2022-04-20 12:53:50 -05:00
committed by Erik Mendoza
parent e98d8af870
commit 0b03a26d1c
2 changed files with 4 additions and 0 deletions

View File

@@ -4825,6 +4825,9 @@ module.exports = {
* @returns {object} - Detect root files result object
*/
mapGetRootFilesOutputToDetectRootFilesOutput(output, version) {
if (!version) {
version = '3.0.0';
}
let adaptedData = output.map((file) => {
return { path: file };
});

View File

@@ -32,6 +32,7 @@ describe('detectRoot method', function() {
expect(res).to.not.be.empty;
expect(res.result).to.be.true;
expect(res.output.data[0].path).to.equal('/petstore.yaml');
expect(res.output.specification.version).to.equal('3.0.0');
});
it('should return one root 3.0 correctly', async function() {