Skip to content

Commit 3f502ee

Browse files
author
Sophia Marie Terry
committed
CLOUDP-306294: Final create, update, delete logic
1 parent 79da6ec commit 3f502ee

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import {
77
getResourcePathItems,
88
} from './utils/resourceEvaluation.js';
99
import { generateOperationID } from './utils/operationIdGeneration.js';
10+
import { isLegacyCustomMethod } from './utils/extensions.js';
1011

1112
const RULE_NAME = 'xgen-IPA-106-valid-operation-id';
1213
const ERROR_MESSAGE = 'Invalid OperationID.';
@@ -17,7 +18,7 @@ export default (input, { methodName }, { path, documentInventory }) => {
1718
const resourcePaths = getResourcePathItems(resourcePath, oas.paths);
1819

1920
const isResourceCollection = isResourceCollectionIdentifier(resourcePath) && !isSingletonResource(resourcePaths);
20-
if (isCustomMethodIdentifier(resourcePath) || !isResourceCollection) {
21+
if (isLegacyCustomMethod(input) || isCustomMethodIdentifier(resourcePath) || !isResourceCollection) {
2122
return;
2223
}
2324

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
isCustomMethodIdentifier,
99
} from './utils/resourceEvaluation.js';
1010
import { generateOperationID } from './utils/operationIdGeneration.js';
11+
import { isLegacyCustomMethod } from './utils/extensions.js';
1112

1213
const RULE_NAME = 'xgen-IPA-107-valid-operation-id';
1314
const ERROR_MESSAGE = 'Invalid OperationID.';
@@ -19,6 +20,7 @@ export default (input, { methodName }, { path, documentInventory }) => {
1920

2021
if (
2122
isCustomMethodIdentifier(resourcePath) ||
23+
isLegacyCustomMethod(input) ||
2224
(!isSingleResourceIdentifier(resourcePath) &&
2325
!(isResourceCollectionIdentifier(resourcePath) && isSingletonResource(resourcePaths)))
2426
) {

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,19 @@ import { hasException } from './utils/exceptions.js';
22
import { collectAdoption, collectException, collectAndReturnViolation } from './utils/collectionUtils.js';
33
import { isCustomMethodIdentifier, isSingleResourceIdentifier } from './utils/resourceEvaluation.js';
44
import { generateOperationID } from './utils/operationIdGeneration.js';
5+
import { isLegacyCustomMethod } from './utils/extensions.js';
56

67
const RULE_NAME = 'xgen-IPA-108-valid-operation-id';
78
const ERROR_MESSAGE = 'Invalid OperationID.';
89

910
export default (input, { methodName }, { path }) => {
1011
const resourcePath = path[1];
1112

12-
if (isCustomMethodIdentifier(resourcePath) || !isSingleResourceIdentifier(resourcePath)) {
13+
if (
14+
isCustomMethodIdentifier(resourcePath) ||
15+
!isSingleResourceIdentifier(resourcePath) ||
16+
isLegacyCustomMethod(input)
17+
) {
1318
return;
1419
}
1520

0 commit comments

Comments
 (0)