11import testRule from './__helpers__/testRule' ;
2-
3- // TODO: add tests for xgen-custom-method extension - CLOUDP-306294
4- // TOOD: enable tests for invalid methods (after rules are upgraded to warning) - CLOUDP-329722
2+ import { DiagnosticSeverity } from '@stoplight/types' ;
53
64testRule ( 'xgen-IPA-104-valid-operation-id' , [
75 {
@@ -17,40 +15,51 @@ testRule('xgen-IPA-104-valid-operation-id', [
1715 } ,
1816 errors : [ ] ,
1917 } ,
20- // This test will be enable when the xgen-IPA-104-valid-operation-id is set to warning severity - CLOUDP-329722
21- /* {
22- name: 'invalid methods',
18+ {
19+ name : 'invalid methods with short opIDs' ,
2320 document : {
2421 paths : {
25- '/api/atlas/v2/groups/{groupId}/accessList/{entryValue}/status': {
26- get: {
27- operationId: 'getProjectIpAccessListStatus',
28- },
29- },
30- '/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}': {
22+ '/api/atlas/v2/groups/{groupId}/accessList/{entryValue}' : {
3123 get : {
32- operationId: 'returnFederatedDatabaseQueryLimit ',
24+ operationId : 'getProjectIpList ' ,
3325 } ,
3426 } ,
3527 } ,
3628 } ,
3729 errors : [
3830 {
3931 code : 'xgen-IPA-104-valid-operation-id' ,
40- message:
41- 'Invalid OperationID. ',
42- path: ['paths', '/api/atlas/v2/groups/{groupId}/accessList/{entryValue}/status', 'get'],
32+ message : 'Invalid OperationID. ' ,
33+ path : [ 'paths' , '/api/atlas/v2/groups/{groupId}/accessList/{entryValue}' , 'get' , 'operationId' ] ,
4334 severity : DiagnosticSeverity . Warning ,
4435 } ,
36+ ] ,
37+ } ,
38+ {
39+ name : 'invalid methods with long opIDs' ,
40+ document : {
41+ paths : {
42+ '/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/queryShapeInsights/{queryShapeHash}/details' : {
43+ get : {
44+ operationId : 'getShardedClusterBackup' ,
45+ } ,
46+ } ,
47+ } ,
48+ } ,
49+ errors : [
4550 {
4651 code : 'xgen-IPA-104-valid-operation-id' ,
47- message:
48- 'Invalid OperationID. ',
49- path: ['paths', '/api/atlas/v2/groups/{groupId}/dataFederation/{tenantName}/limits/{limitName}', 'get'],
52+ message : 'Invalid OperationID. ' ,
53+ path : [
54+ 'paths' ,
55+ '/api/atlas/v2/groups/{groupId}/clusters/{clusterName}/queryShapeInsights/{queryShapeHash}/details' ,
56+ 'get' ,
57+ 'operationId' ,
58+ ] ,
5059 severity : DiagnosticSeverity . Warning ,
5160 } ,
5261 ] ,
53- }, */
62+ } ,
5463 {
5564 name : 'invalid methods with exceptions' ,
5665 document : {
0 commit comments