|
9 | 9 | operation-tags: false |
10 | 10 | operation-2xx-response: error |
11 | 11 |
|
12 | | - adidas-paths-camelCase: |
13 | | - description: All YAML/JSON paths MUST follow camelCase |
| 12 | + adidas-paths-kebab-case: |
| 13 | + description: All YAML/JSON paths MUST follow kebab-case |
14 | 14 | severity: warn |
15 | 15 | recommended: true |
16 | | - message: "{{property}} is not camelCase: {{error}}" |
| 16 | + message: "{{property}} is not kebab-case: {{error}}" |
17 | 17 | given: $.paths[*]~ |
18 | 18 | then: |
19 | 19 | function: pattern |
20 | 20 | functionOptions: |
21 | | - # match: "/^(\/{1}(([{]?[a-z])[A-Za-z0-9]*[}]?)*)+$/" # - more generic one, allows /asasd{asdas}sadas pattern but also not closed braces |
22 | | - match: "^\/([a-z][a-zA-Z0-9]+)?(\/[a-z][a-zA-Z0-9]+|\/{[a-z][a-zA-Z0-9]+})*$" # doesn't allow /asasd{asdas}sadas pattern or not closed braces |
| 21 | + match: "^\/([a-z0-9]+(-[a-z0-9]+)*)?(\/[a-z0-9]+(-[a-z0-9]+)*|\/{.+})*$" # doesn't allow /asasd{asdas}sadas pattern or not closed braces |
| 22 | + |
| 23 | + adidas-path-parameters-camelCase-alphanumeric: |
| 24 | + description: Path parameters MUST follow camelCase |
| 25 | + severity: warn |
| 26 | + recommended: true |
| 27 | + message: "{{property}} path parameter is not camelCase: {{error}}" |
| 28 | + given: $..parameters[?(@.in == 'path')].name |
| 29 | + then: |
| 30 | + function: pattern |
| 31 | + functionOptions: |
| 32 | + match: "^[a-z][a-zA-Z0-9]+$" |
23 | 33 |
|
24 | 34 | adidas-definitions-camelCase-alphanumeric: |
25 | 35 | description: All YAML/JSON definitions MUST follow fields-camelCase and be ASCII alphanumeric characters or `_` or `$`. |
@@ -52,17 +62,6 @@ rules: |
52 | 62 | functionOptions: |
53 | 63 | notMatch: "/^body$/" |
54 | 64 |
|
55 | | - adidas-uri-template-cannot-dash: |
56 | | - description: "The 'URI' template (RFC 6570 - https://tools.ietf.org/html/rfc6570) cannot contain a '-' character" |
57 | | - severity: error |
58 | | - recommended: true |
59 | | - message: "{{property}}: {{description}}" |
60 | | - given: "$.paths[*]~" |
61 | | - then: |
62 | | - function: pattern |
63 | | - functionOptions: |
64 | | - notMatch: "/-/" |
65 | | - |
66 | 65 | adidas-headers-no-x-headers: |
67 | 66 | description: "All 'HTTP' headers SHOULD NOT include 'X-' headers (https://tools.ietf.org/html/rfc6648)." |
68 | 67 | severity: warn |
|
0 commit comments