Skip to content

Commit a3dd704

Browse files
IPA-114: Errors (fix for exception level)
1 parent 9bd1415 commit a3dd704

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

tools/spectral/ipa/__tests__/IPA114ErrorResponsesReferToApiError.test.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,18 +204,19 @@ testRule('xgen-IPA-114-error-responses-refer-to-api-error', [
204204
get: {
205205
responses: {
206206
400: {
207+
'x-xgen-IPA-exception': {
208+
'xgen-IPA-114-error-responses-refer-to-api-error': 'Reason',
209+
},
207210
content: {
208211
'application/json': {
209212
schema: {
210213
type: 'object',
211214
},
212-
'x-xgen-IPA-exception': {
213-
'xgen-IPA-114-error-responses-refer-to-api-error': 'Reason',
214-
},
215215
},
216216
},
217217
},
218218
500: {
219+
description: "Internal Service Error",
219220
'x-xgen-IPA-exception': {
220221
'xgen-IPA-114-error-responses-refer-to-api-error': 'Reason',
221222
},

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,7 @@ function checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode)
5656
continue;
5757
}
5858

59-
if (hasException(mediaTypeObj, RULE_NAME)) {
60-
collectException(mediaTypeObj, RULE_NAME, [...path, 'content', mediaType]);
61-
continue;
62-
}
63-
6459
const contentPath = [...path, 'content', mediaType];
65-
6660
// Check if schema exists
6761
if (!mediaTypeObj.schema) {
6862
errors.push({

0 commit comments

Comments
 (0)