Skip to content

Commit c0502df

Browse files
Apply suggestions from code review
Co-authored-by: Yeliz Henden <[email protected]>
1 parent 4c12229 commit c0502df

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/spectral/ipa/rulesets/functions/deleteMethodResponseShouldNotHaveSchema.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,15 @@ const ERROR_MESSAGE =
1313
*/
1414
export default (input, _, { path }) => {
1515
const deleteOp = input;
16-
16+
if(!deleteOp.responses || deleteOp.responses.length === 0) {
17+
return;
18+
}
1719
if (hasException(deleteOp, RULE_NAME)) {
1820
collectException(deleteOp, RULE_NAME, path);
1921
return;
2022
}
2123

22-
const responses = deleteOp.responses || {};
24+
const responses = deleteOp.responses;
2325
for (const [status, response] of Object.entries(responses)) {
2426
if (status === '204' && response.content) {
2527
for (const contentType of Object.keys(response.content)) {

0 commit comments

Comments
 (0)