Skip to content

Commit c632cd6

Browse files
address the comments
1 parent e2b25a0 commit c632cd6

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import { evaluateAndCollectAdoptionStatus, handleInternalError } from './utils/collectionUtils.js';
1+
import {
2+
evaluateAndCollectAdoptionStatus,
3+
handleInternalError,
4+
} from './utils/collectionUtils.js';
25
import { isPathParam } from './utils/componentUtils.js';
36
import { casing } from '@stoplight/spectral-functions';
47
import { findExceptionInPathHierarchy } from './utils/exceptions.js';
@@ -29,9 +32,9 @@ export default (input, options, { path, documentInventory }) => {
2932
if (result?.error) {
3033
return result.error;
3134
}
32-
const objectToCheck = result ? oas.paths[result.parentPath] : oas.paths[input];
35+
const objectToCheckForException = result ? oas.paths[result.parentPath] : oas.paths[input];
3336

34-
return evaluateAndCollectAdoptionStatus(violations, RULE_NAME, objectToCheck, path);
37+
return evaluateAndCollectAdoptionStatus(violations, RULE_NAME, objectToCheckForException, path);
3538
};
3639

3740
function checkViolations(pathKey, path, ignoredValues = []) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export default (input, _, { path, documentInventory }) => {
2525
if (result?.error) {
2626
return result.error;
2727
}
28-
const objectToCheck = result ? oas.paths[result.parentPath] : oas.paths[input];
28+
const objectToCheckForException = result ? oas.paths[result.parentPath] : oas.paths[input];
2929

30-
return evaluateAndCollectAdoptionStatus(violations, RULE_NAME, objectToCheck, path);
30+
return evaluateAndCollectAdoptionStatus(violations, RULE_NAME, objectToCheckForException, path);
3131
};
3232

3333
function checkViolations(pathKey, path) {

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import { isPathParam } from './utils/componentUtils.js';
2-
import { evaluateAndCollectAdoptionStatus, handleInternalError } from './utils/collectionUtils.js';
2+
import {
3+
evaluateAndCollectAdoptionStatus,
4+
handleInternalError,
5+
} from './utils/collectionUtils.js';
36
import { AUTH_PREFIX, UNAUTH_PREFIX } from './utils/resourceEvaluation.js';
47
import { findExceptionInPathHierarchy } from './utils/exceptions.js';
58

@@ -53,9 +56,9 @@ export default (input, _, { path, documentInventory }) => {
5356
return result.error;
5457
}
5558

56-
const objectToCheck = result ? oas.paths[result.parentPath] : oas.paths[input];
59+
const objectToCheckForException = result ? oas.paths[result.parentPath] : oas.paths[input];
5760

58-
return evaluateAndCollectAdoptionStatus(errors, RULE_NAME, objectToCheck, path);
61+
return evaluateAndCollectAdoptionStatus(errors, RULE_NAME, objectToCheckForException, path);
5962
};
6063

6164
function checkViolationsAndReturnErrors(suffixWithLeadingSlash, path) {

0 commit comments

Comments
 (0)