Skip to content

Commit d8826c6

Browse files
test commit
1 parent 1ef4aca commit d8826c6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ export default (input, _, { path, documentInventory }) => {
2121
const oas = documentInventory.unresolved;
2222
const resolvedOas = documentInventory.resolved;
2323
const apiResponseObject = resolveObject(oas, path);
24+
const resolvedApiResponseObject = resolveObject(resolvedOas, path);
2425
const errorCode = path[path.length - 1];
2526

2627
// Check for exception at response level
@@ -29,15 +30,15 @@ export default (input, _, { path, documentInventory }) => {
2930
return;
3031
}
3132

32-
const errors = checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode, resolvedOas);
33+
const errors = checkViolationsAndReturnErrors(apiResponseObject, resolvedApiResponseObject, oas, path, errorCode);
3334
if (errors.length !== 0) {
3435
return collectAndReturnViolation(path, RULE_NAME, errors);
3536
}
3637

3738
collectAdoption(path, RULE_NAME);
3839
};
3940

40-
function checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode, resolvedOas) {
41+
function checkViolationsAndReturnErrors(apiResponseObject, resolvedApiResponseObject, oas, path, errorCode) {
4142
try {
4243
const errors = [];
4344
let content;
@@ -55,7 +56,7 @@ function checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode,
5556
content = responseSchema.content;
5657
} else {
5758
console.log(ref);
58-
console.log(resolvedOas);
59+
console.log(resolvedApiResponseObject);
5960
}
6061

6162
} else {

0 commit comments

Comments
 (0)