@@ -18,22 +18,22 @@ const RULE_NAME = 'xgen-IPA-114-error-responses-refer-to-api-error';
1818 * @param {object } context - The context object containing path and document information
1919 */
2020export default ( input , _ , { path, documentInventory } ) => {
21- const oas = documentInventory . unresolved ;
22- const apiResponseObject = resolveObject ( oas , path ) ;
23- const errorCode = path [ path . length - 1 ] ;
21+ const oas = documentInventory . unresolved ;
22+ const apiResponseObject = resolveObject ( oas , path ) ;
23+ const errorCode = path [ path . length - 1 ] ;
2424
25- // Check for exception at response level
26- if ( hasException ( apiResponseObject , RULE_NAME ) ) {
27- collectException ( apiResponseObject , RULE_NAME , path ) ;
28- return ;
29- }
25+ // Check for exception at response level
26+ if ( hasException ( apiResponseObject , RULE_NAME ) ) {
27+ collectException ( apiResponseObject , RULE_NAME , path ) ;
28+ return ;
29+ }
3030
31- const errors = checkViolationsAndReturnErrors ( apiResponseObject , oas , path , errorCode ) ;
32- if ( errors . length !== 0 ) {
33- return collectAndReturnViolation ( path , RULE_NAME , errors ) ;
34- }
31+ const errors = checkViolationsAndReturnErrors ( apiResponseObject , oas , path , errorCode ) ;
32+ if ( errors . length !== 0 ) {
33+ return collectAndReturnViolation ( path , RULE_NAME , errors ) ;
34+ }
3535
36- collectAdoption ( path , RULE_NAME ) ;
36+ collectAdoption ( path , RULE_NAME ) ;
3737} ;
3838
3939function checkViolationsAndReturnErrors ( apiResponseObject , oas , path , errorCode ) {
0 commit comments