Skip to content

Commit 453b1c7

Browse files
test commit
1 parent 9774042 commit 453b1c7

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

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

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import { hasException } from './utils/exceptions.js';
22
import {
33
collectAdoption,
4-
collectAndReturnViolation,
54
collectException,
6-
handleInternalError,
75
} from './utils/collectionUtils.js';
86
import { resolveObject } from './utils/componentUtils.js';
9-
import { getSchemaNameFromRef } from './utils/methodUtils.js';
107

118
const RULE_NAME = 'xgen-IPA-114-error-responses-refer-to-api-error';
129

@@ -20,22 +17,22 @@ const RULE_NAME = 'xgen-IPA-114-error-responses-refer-to-api-error';
2017
export default (input, _, { path, documentInventory }) => {
2118
const oas = documentInventory.unresolved;
2219
const apiResponseObject = resolveObject(oas, path);
23-
const errorCode = path[path.length - 1];
20+
//const errorCode = path[path.length - 1];
2421

2522
// Check for exception at response level
2623
if (hasException(apiResponseObject, RULE_NAME)) {
2724
collectException(apiResponseObject, RULE_NAME, path);
2825
return;
2926
}
3027

31-
const errors = checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode);
28+
/*const errors = checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode);
3229
if (errors.length !== 0) {
3330
return collectAndReturnViolation(path, RULE_NAME, errors);
3431
}
35-
32+
*/
3633
collectAdoption(path, RULE_NAME);
3734
};
38-
35+
/*
3936
function checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode) {
4037
try {
4138
const errors = [];
@@ -81,3 +78,4 @@ function checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode)
8178
handleInternalError(RULE_NAME, path, e);
8279
}
8380
}
81+
*/

0 commit comments

Comments
 (0)