@@ -22,30 +22,50 @@ rules:
2222 given : $.paths
2323 then :
2424 field : ' @key'
25- function : collectionIdentifierCamelCase
25+ function : IPA102CollectionIdentifierCamelCase
2626 functionOptions :
2727 # Contains list of ignored path params
2828 ignoredValues : ['v2', 'v1']
2929
3030 xgen-IPA-102-path-alternate-resource-name-path-param :
31- description : ' Paths should alternate between resource names and path params.'
31+ description : |
32+ Paths should alternate between resource names and path params.
33+
34+ ##### Implementation details
35+ Rule checks for the following conditions:
36+
37+ - Paths must follow a pattern where resource names and path parameters strictly alternate
38+ - Even-indexed path segments should be resource names (not path parameters)
39+ - Odd-indexed path segments should be path parameters
40+ - Paths with `x-xgen-IPA-exception` for this rule are excluded from validation
3241 message : ' {{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-102-path-alternate-resource-name-path-param'
3342 severity : error
3443 given : ' $.paths'
3544 then :
3645 field : ' @key'
37- function : ' eachPathAlternatesBetweenResourceNameAndPathParam '
46+ function : IPA102EachPathAlternatesBetweenResourceNameAndPathParam
3847
3948 xgen-IPA-102-collection-identifier-pattern :
40- description : Collection identifiers must begin with a lowercase letter and contain only ASCII letters and numbers.
49+ description : |
50+ Collection identifiers must begin with a lowercase letter and contain only ASCII letters and numbers.
51+
52+ ##### Implementation details
53+ Rule checks for the following conditions:
54+
55+ - All path segments that are not path parameters must match pattern `/^[a-z][a-zA-Z0-9]*$/`
56+ - Path parameters (inside curly braces) are excluded from validation
57+ - Custom methods (segments containing colons) are excluded from validation
58+ - Paths with `x-xgen-IPA-exception` for this rule are excluded from validation
59+ - Each non-parameter path segment must start with a lowercase letter followed by any combination of ASCII letters and numbers
60+
4161 message : ' {{error}} https://mdb.link/mongodb-atlas-openapi-validation#xgen-IPA-102-collection-identifier-pattern'
4262 severity : warn
4363 given : $.paths
4464 then :
4565 field : ' @key'
46- function : collectionIdentifierPattern
66+ function : IPA102CollectionIdentifierPattern
4767
4868functions :
49- - collectionIdentifierPattern
50- - eachPathAlternatesBetweenResourceNameAndPathParam
51- - collectionIdentifierCamelCase
69+ - IPA102CollectionIdentifierPattern
70+ - IPA102EachPathAlternatesBetweenResourceNameAndPathParam
71+ - IPA102CollectionIdentifierCamelCase
0 commit comments