Skip to content

Commit a717d0e

Browse files
address the comments
1 parent 281b54c commit a717d0e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function checkViolationsAndReturnErrors(apiResponseObject, oas, path, errorCode)
7575
// Check if schema references ApiError
7676
const schema = mediaTypeObj.schema;
7777

78-
if (!schema.$ref || !schema.$ref.endsWith('/ApiError')) {
78+
if (!schema.$ref || getSchemaNameFromRef(schema.$ref) !== 'ApiError') {
7979
errors.push({
8080
path: contentPath,
8181
message: `${errorCode} response must reference ApiError schema.`,

0 commit comments

Comments
 (0)