11import { hasException } from './utils/exceptions.js' ;
22import {
33 collectAdoption ,
4- collectAndReturnViolation ,
54 collectException ,
6- handleInternalError ,
75} from './utils/collectionUtils.js' ;
86import { resolveObject } from './utils/componentUtils.js' ;
9- import { getSchemaNameFromRef } from './utils/methodUtils.js' ;
107
118const 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';
2017export 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+ /*
3936function 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