Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,29 @@
"swagger-jsdoc": "./bin/swagger-jsdoc.js"
},
"dependencies": {
"@apidevtools/swagger-parser": "^12.1.0",
"commander": "6.2.0",
"doctrine": "3.0.0",
"glob": "7.1.6",
"lodash.mergewith": "^4.6.2",
"swagger-parser": "^10.0.3",
"yaml": "2.0.0-1"
},
"devDependencies": {
"body-parser": "1.20.2",
"eslint": "8.9.0",
"body-parser": "1.20.3",
"eslint": "8.57.1",
"eslint-config-airbnb-base": "15.0.0",
"eslint-config-prettier": "6.15.0",
"eslint-plugin-import": "2.25.4",
"eslint-plugin-jest": "26.1.1",
"eslint-plugin-prettier": "3.1.4",
"eslint-webpack-plugin": "^4.0.1",
"express": "4.17.3",
"express": "4.21.2",
"husky": "7.0.4",
"jest": "^26.6.1",
"jest": "^29.7.0",
"lint-staged": "10.5.2",
"npm-run-all": "4.1.5",
"npm-run-all2": "6.2.6",
"prettier": "2.2.0",
"supertest": "6.0.1"
"supertest": "7.1.4"
},
"license": "MIT",
"homepage": "https://github.com/Surnet/swagger-jsdoc",
Expand Down
2 changes: 1 addition & 1 deletion src/specification.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const doctrine = require('doctrine');
const parser = require('swagger-parser');
const parser = require('@apidevtools/swagger-parser');
const YAML = require('yaml');

const {
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/cli.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports[`CLI module should generate yml final file from separated files 1`] = `

exports[`CLI module should reject definition file with invalid JSON syntax 1`] = `
"Error while loading definition file 'test/files/v2/wrong_syntax.json':
Unexpected token t in JSON at position 18
Expected property name or '}' in JSON at position 18 (line 3 column 5)
"
`;

Expand Down
16 changes: 12 additions & 4 deletions test/cli.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,17 @@ describe('CLI module', () => {
});

afterAll(() => {
fs.unlinkSync(`${dir}/swagger.json`);
fs.unlinkSync(`${dir}/customSpec.json`);
fs.unlinkSync(`${dir}/customSpec.yaml`);
fs.unlinkSync(`${dir}/customSpec.yml`);
const tryUnlink = (file) => {
try {
fs.unlinkSync(file);
} catch (e) {
// File may not exist
}
};

tryUnlink(`${dir}/swagger.json`);
tryUnlink(`${dir}/customSpec.json`);
tryUnlink(`${dir}/customSpec.yaml`);
tryUnlink(`${dir}/customSpec.yml`);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can also just skip removing this non existent file (instead of wrapping in try/catch)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this failing or the try catch is working as expected?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Try catch is working as expected. But the .yml file doesn't exist - so we can alternatively just remove line 152 (like I do in my other PR).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets do it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the code merged to main, this should already be done though obviously I don't have permissions to resolve conflicts here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I'm trying to fix the yaml version first to keep working into the remaining PRs

});
});
Loading