Skip to content

Commit ca3f232

Browse files
author
Sophia Marie Terry
committed
Fix IPA104 test with good example
1 parent 035946d commit ca3f232

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

tools/spectral/ipa/__tests__/IPA104ValidOperationID.test.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ testRule('xgen-IPA-104-valid-operation-id', [
3939
name: 'invalid methods with long opIDs',
4040
document: {
4141
paths: {
42-
'/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/queryShapeInsights/{queryShapeHash}/details': {
42+
'/api/atlas/v2/groups/{groupId}/alerts/{alertId}/alertConfigs': {
4343
get: {
44-
operationId: 'getShardedClusterBackup',
44+
operationId: 'listAlertConfigurationsByAlertId',
4545
},
4646
},
4747
},
@@ -50,12 +50,14 @@ testRule('xgen-IPA-104-valid-operation-id', [
5050
{
5151
code: 'xgen-IPA-104-valid-operation-id',
5252
message: 'Invalid OperationID. ',
53-
path: [
54-
'paths',
55-
'/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/queryShapeInsights/{queryShapeHash}/details',
56-
'get',
57-
'operationId',
58-
],
53+
path: ['paths', '/api/atlas/v2/groups/{groupId}/alerts/{alertId}/alertConfigs', 'get', 'operationId'],
54+
severity: DiagnosticSeverity.Warning,
55+
},
56+
{
57+
code: 'xgen-IPA-104-valid-operation-id',
58+
message:
59+
"The Operation ID is longer than 4 words. Please add an 'x-xgen-operation-id-override' extension to the operation with a shorter operation ID. ",
60+
path: ['paths', '/api/atlas/v2/groups/{groupId}/alerts/{alertId}/alertConfigs', 'get', 'operationId'],
5961
severity: DiagnosticSeverity.Warning,
6062
},
6163
],

tools/spectral/ipa/rulesets/IPA-104.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ rules:
115115
then:
116116
function: 'IPA104ValidOperationID'
117117
functionOptions:
118-
methodName: 'get'
118+
methodName: 'get'

0 commit comments

Comments
 (0)