Skip to content

Commit f987728

Browse files
author
Sophia Marie Terry
committed
CLOUDP-330237: Removed OperationID Validation yamls and updated docs
1 parent be928d6 commit f987728

File tree

7 files changed

+1
-192
lines changed

7 files changed

+1
-192
lines changed

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ functions:
88
- IPA104GetResponseCodeShouldBe200OK
99
- IPA104GetMethodResponseHasNoInputFields
1010
- IPA104GetMethodHasNoRequestBody
11-
- IPA104ValidOperationID
1211

1312
aliases:
1413
GetOperationObject:
@@ -98,21 +97,3 @@ rules:
9897
given: '#GetOperationObject'
9998
then:
10099
function: 'IPA104GetMethodHasNoRequestBody'
101-
xgen-IPA-104-valid-operation-id:
102-
description: |
103-
The Operation ID must start with the verb “get” and should be followed by a noun or compound noun.
104-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
105-
If the resource is a singleton resource, the last noun may be the plural form of the collection identifier.
106-
107-
##### Implementation details
108-
Rule checks for the following conditions:
109-
- Applies only to GET methods on single resources or singleton resources
110-
- Generates the expected OperationId given the resource identifier
111-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
112-
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-104-valid-operation-id'
113-
severity: off
114-
given: '#GetOperationObject'
115-
then:
116-
function: 'IPA104ValidOperationID'
117-
functionOptions:
118-
methodName: 'get'

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ functions:
66
- IPA105ListMethodHasNoRequestBody
77
- IPA105EachResourceHasListMethod
88
- IPA105ListMethodResponseIsGetMethodResponse
9-
- IPA105ValidOperationID
109

1110
aliases:
1211
GetOperationObject:
@@ -78,21 +77,3 @@ rules:
7877
then:
7978
field: '@key'
8079
function: 'IPA105ListMethodResponseIsGetMethodResponse'
81-
xgen-IPA-105-valid-operation-id:
82-
description: |
83-
The Operation ID must start with the verb “list” and should be followed by a noun or compound noun.
84-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form, where the last noun is in plural form.
85-
86-
##### Implementation details
87-
Rule checks for the following conditions:
88-
- Applies only to GET methods on resource collection paths
89-
- Ignores singleton resources
90-
- Generates the expected OperationId given the resource identifier
91-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
92-
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-105-valid-operation-id'
93-
severity: off
94-
given: '#GetOperationObject'
95-
then:
96-
function: 'IPA105ValidOperationID'
97-
functionOptions:
98-
methodName: 'list'

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ functions:
88
- IPA106CreateMethodRequestHasNoReadonlyFields
99
- IPA106CreateMethodResponseCodeIs201Created
1010
- IPA106CreateMethodResponseIsGetMethodResponse
11-
- IPA106ValidOperationID
1211

1312
aliases:
1413
CreateOperationObject:
@@ -113,20 +112,3 @@ rules:
113112
then:
114113
field: '@key'
115114
function: 'IPA106CreateMethodResponseIsGetMethodResponse'
116-
xgen-IPA-106-valid-operation-id:
117-
description: |
118-
The Operation ID must start with the verb “create” and should be followed by a noun or compound noun.
119-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
120-
121-
##### Implementation details
122-
Rule checks for the following conditions:
123-
- Applies only to POST methods on resource collection paths
124-
- Generates the expected OperationId given the resource identifier
125-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
126-
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-106-valid-operation-id'
127-
severity: off
128-
given: '#CreateOperationObject'
129-
then:
130-
function: 'IPA106ValidOperationID'
131-
functionOptions:
132-
methodName: 'create'

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

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ functions:
88
- IPA107UpdateMethodRequestHasNoReadonlyFields
99
- IPA107UpdateMethodRequestBodyIsGetResponse
1010
- IPA107UpdateMethodRequestBodyIsUpdateRequestSuffixedObject
11-
- IPA107ValidOperationID
1211

1312
aliases:
1413
UpdateOperationObject:
@@ -112,22 +111,4 @@ rules:
112111
given: '#UpdateOperationObject.requestBody.content'
113112
then:
114113
field: '@key'
115-
function: 'IPA107UpdateMethodRequestBodyIsUpdateRequestSuffixedObject'
116-
xgen-IPA-107-valid-operation-id:
117-
description: |
118-
The Operation ID must start with the verb “update” and should be followed by a noun or compound noun.
119-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
120-
If the resource is a singleton resource, the last noun may be the plural form of the collection identifier.
121-
122-
##### Implementation details
123-
Rule checks for the following conditions:
124-
- Validation checks the PATCH/PUT methods for single resource paths and [singleton resources](https://go/ipa/113).
125-
- Generates the expected OperationId given the resource identifier
126-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
127-
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-107-valid-operation-id'
128-
severity: off
129-
given: '#UpdateOperationObject'
130-
then:
131-
function: 'IPA107ValidOperationID'
132-
functionOptions:
133-
methodName: 'update'
114+
function: 'IPA107UpdateMethodRequestBodyIsUpdateRequestSuffixedObject'

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

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -55,26 +55,8 @@ rules:
5555
given: '#DeleteOperationObject'
5656
then:
5757
function: IPA108DeleteMethodNoRequestBody
58-
xgen-IPA-108-valid-operation-id:
59-
description: |
60-
The Operation ID must start with the verb “delete” and should be followed by a noun or compound noun.
61-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
62-
63-
##### Implementation details
64-
Rule checks for the following conditions:
65-
- Applies to all DELETE methods for single resource endpoints (with path parameters)
66-
- Generates the expected OperationId given the resource identifier
67-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
68-
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-108-valid-operation-id'
69-
severity: off
70-
given: '#DeleteOperationObject'
71-
then:
72-
function: 'IPA108ValidOperationID'
73-
functionOptions:
74-
methodName: 'delete'
7558

7659
functions:
7760
- IPA108DeleteMethodResponseShouldNotHaveSchema
7861
- IPA108DeleteMethod204Response
7962
- IPA108DeleteMethodNoRequestBody
80-
- IPA108ValidOperationID

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,3 @@ rules:
5757
given: '$.paths[*]'
5858
then:
5959
function: 'IPA109CustomMethodIdentifierFormat'
60-
xgen-IPA-109-valid-operation-id:
61-
description: |
62-
The Operation ID must start with the custom method verb (the custom method path section delimited by the colon (:) character) and should be followed by a noun or compound noun.
63-
If the custom Operation ID has a verb + noun, the Operation ID should end with the noun.
64-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier.
65-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form, where the last noun:
66-
- Is in plural form if the method applies to a collection of resources
67-
- Is in singular form if the method applies to a single resource
68-
69-
##### Implementation details
70-
Rule checks for the following conditions:
71-
- Applies only to paths containing custom method identifiers (with colon format)
72-
- Generates the expected OperationId given the resource identifier and the method name portion following the colon
73-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
74-
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-109-valid-operation-id'
75-
severity: off
76-
given: '$.paths[*]'
77-
then:
78-
function: 'IPA109ValidOperationID'

tools/spectral/ipa/rulesets/README.md

Lines changed: 0 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -139,19 +139,6 @@ Rule checks for the following conditions:
139139
- Applies only to GET methods on single resources or singleton resources
140140
- Verifies that the operation object does not contain a requestBody property
141141

142-
#### xgen-IPA-104-valid-operation-id
143-
144-
`off`
145-
The Operation ID must start with the verb “get” and should be followed by a noun or compound noun.
146-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
147-
If the resource is a singleton resource, the last noun may be the plural form of the collection identifier.
148-
149-
##### Implementation details
150-
Rule checks for the following conditions:
151-
- Applies only to GET methods on single resources or singleton resources
152-
- Generates the expected OperationId given the resource identifier
153-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
154-
155142

156143

157144
### IPA-105
@@ -206,19 +193,6 @@ The response body of the List method should consist of the same resource object
206193
- Fails if the Get method doesn't have a schema reference or if the schemas don't match
207194
- Validation ignores resources without a Get method
208195
- Paths with `x-xgen-IPA-exception` for this rule are excluded from validation
209-
#### xgen-IPA-105-valid-operation-id
210-
211-
`off`
212-
The Operation ID must start with the verb “list” and should be followed by a noun or compound noun.
213-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form, where the last noun is in plural form.
214-
215-
##### Implementation details
216-
Rule checks for the following conditions:
217-
- Applies only to GET methods on resource collection paths
218-
- Ignores singleton resources
219-
- Generates the expected OperationId given the resource identifier
220-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
221-
222196

223197

224198
### IPA-106
@@ -299,18 +273,6 @@ Rule checks for the following conditions:
299273
- Ignores resources without a Get method
300274
- Paths with `x-xgen-IPA-exception` for this rule are excluded from validation
301275

302-
#### xgen-IPA-106-valid-operation-id
303-
304-
`off`
305-
The Operation ID must start with the verb “create” and should be followed by a noun or compound noun.
306-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
307-
308-
##### Implementation details
309-
Rule checks for the following conditions:
310-
- Applies only to POST methods on resource collection paths
311-
- Generates the expected OperationId given the resource identifier
312-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
313-
314276

315277

316278
### IPA-107
@@ -382,19 +344,6 @@ Rule checks for the following conditions:
382344
- Validation only applies to schema references to a predefined schema (not inline)
383345
- Confirms the referenced schema name ends with "Request" suffix
384346

385-
#### xgen-IPA-107-valid-operation-id
386-
387-
`off`
388-
The Operation ID must start with the verb “update” and should be followed by a noun or compound noun.
389-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
390-
If the resource is a singleton resource, the last noun may be the plural form of the collection identifier.
391-
392-
##### Implementation details
393-
Rule checks for the following conditions:
394-
- Validation checks the PATCH/PUT methods for single resource paths and [singleton resources](https://go/ipa/113).
395-
- Generates the expected OperationId given the resource identifier
396-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
397-
398347

399348

400349
### IPA-108
@@ -439,18 +388,6 @@ Rule checks for the following conditions:
439388
- Fails if any requestBody is defined for the DELETE method
440389
- Skips validation for collection endpoints (without path parameters)
441390

442-
#### xgen-IPA-108-valid-operation-id
443-
444-
`off`
445-
The Operation ID must start with the verb “delete” and should be followed by a noun or compound noun.
446-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form.
447-
448-
##### Implementation details
449-
Rule checks for the following conditions:
450-
- Applies to all DELETE methods for single resource endpoints (with path parameters)
451-
- Generates the expected OperationId given the resource identifier
452-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
453-
454391

455392

456393
### IPA-109
@@ -496,22 +433,6 @@ Rule checks for the following conditions:
496433
- Fails if multiple colons appear in the path
497434
- Fails if other than an alphabetical character or a closing curly brace appears before a colon
498435

499-
#### xgen-IPA-109-valid-operation-id
500-
501-
`off`
502-
The Operation ID must start with the custom method verb (the custom method path section delimited by the colon (:) character) and should be followed by a noun or compound noun.
503-
If the custom Operation ID has a verb + noun, the Operation ID should end with the noun.
504-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier.
505-
The noun(s) in the Operation ID should be the collection identifiers from the resource identifier in singular form, where the last noun:
506-
- Is in plural form if the method applies to a collection of resources
507-
- Is in singular form if the method applies to a single resource
508-
509-
##### Implementation details
510-
Rule checks for the following conditions:
511-
- Applies only to paths containing custom method identifiers (with colon format)
512-
- Generates the expected OperationId given the resource identifier and the method name portion following the colon
513-
- Confirms that the existing operationId is compliant with generated IPA Compliant OperationId
514-
515436

516437

517438
### IPA-110

0 commit comments

Comments
 (0)