Skip to content

Commit 6658fe1

Browse files
author
Sophia Marie Terry
committed
Update IPA104 opID rule
1 parent 0f463dc commit 6658fe1

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

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

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,19 @@ rules:
100100
function: 'IPA104GetMethodHasNoRequestBody'
101101
xgen-IPA-104-valid-operation-id:
102102
description: |
103-
104-
message: '{{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-105-valid-operation-id'
105-
severity: warn
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
106114
given: '#GetOperationObject'
107115
then:
108116
function: 'IPA104ValidOperationID'
109117
functionOptions:
110-
methodName: 'get'
111-
prefixes: ['/api']
118+
methodName: 'get'

0 commit comments

Comments
 (0)