You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/@v2/rules/built-in-rules.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ The rules list is split into sections.
60
60
### Parameters
61
61
62
62
-[array-parameter-serialization](./oas/array-parameter-serialization.md): Require `style` and `explode` for parameters with array type
63
-
-[boolean-parameter-prefixes](./oas/boolean-parameter-prefixes.md): All boolean paramater names start with a particular prefix (such as "is")
63
+
-[boolean-parameter-prefixes](./oas/boolean-parameter-prefixes.md): All boolean parameter names start with a particular prefix (such as "is")
64
64
-[no-invalid-parameter-examples](./oas/no-invalid-parameter-examples.md): Parameter examples must match declared schema types
65
65
-[operation-parameters-unique](./oas/operation-parameters-unique.md): No repeated parameter names within an operation
66
66
-[parameter-description](./oas/parameter-description.md): Parameters must all have descriptions
@@ -72,14 +72,15 @@ The rules list is split into sections.
72
72
73
73
-[no-ambiguous-paths](./oas/no-ambiguous-paths.md): No path can match more than one PathItem entry, including template variables
74
74
-[no-http-verbs-in-paths](./oas/no-http-verbs-in-paths.md): Verbs like "get" cannot be used in paths
75
+
-[path-http-verbs-order](./oas/path-http-verbs-order.md): HTTP operations on each path must follow a configured verb order
75
76
-[no-identical-paths](./oas/no-identical-paths.md): Paths cannot be identical, including template variables
76
77
-[no-path-trailing-slash](./oas/no-path-trailing-slash.md): No trailing slashes on paths
77
78
-[path-segment-plural](./oas/path-segment-plural.md): All URL segments in a path must be plural (exceptions can be configured)
78
79
-[paths-kebab-case](./oas/paths-kebab-case.md): Paths must be in `kebab-case` format
79
80
80
81
### Requests, Responses, and Schemas
81
82
82
-
-[component-name-unique](./oas/component-name-unique.md): Check for schema-wide unqiue naming of parameters, schemas, request bodies and responses
83
+
-[component-name-unique](./oas/component-name-unique.md): Check for schema-wide unique naming of parameters, schemas, request bodies and responses
83
84
-[no-enum-type-mismatch](./common/no-enum-type-mismatch.md): Enum options must match the data type declared in the schema
84
85
-[no-example-value-and-externalValue](./oas/no-example-value-and-externalValue.md): Either the `value` or `externalValue` may be present, but not both
85
86
-[no-invalid-media-type-examples](./oas/no-invalid-media-type-examples.md): Example request bodies must match the declared schema
@@ -132,8 +133,8 @@ Within the Arazzo family of rules, there are rules for the main Arazzo specifica
132
133
-[outputs-defined](./arazzo/outputs-defined.md): the output value should be defined before usage
133
134
-[parameters-unique](./arazzo/parameters-unique.md): the `parameters` list must not include duplicate parameters
134
135
-[requestBody-replacements-unique](./arazzo/requestBody-replacements-unique.md): the `replacements` of the `requestBody` object must be unique
135
-
-[sourceDescriptions-name-unique](./arazzo/sourceDescriptions-name-unique.md): the `name` property of the `sourceDescription` object must be unique across all source descriptions
136
-
-[sourceDescriptions-type](./arazzo/sourceDescriptions-type.md): the `type` property of the `sourceDescription` object must be either `openapi` or `arazzo`
136
+
-[sourceDescription-name-unique](./arazzo/sourceDescription-name-unique.md): the `name` property of the `sourceDescription` object must be unique across all source descriptions
137
+
-[sourceDescription-type](./arazzo/sourceDescription-type.md): the `type` property of the `sourceDescription` object must be either `openapi` or `arazzo`
137
138
-[stepId-unique](./arazzo/stepId-unique.md): the `stepId` must be unique amongst all steps described in the workflow
138
139
-[step-onFailure-unique](./arazzo/step-onFailure-unique.md): the `onFailure` actions of the `step` object must be unique
139
140
-[step-onSuccess-unique](./arazzo/step-onSuccess-unique.md): the `onSuccess` actions of the `step` object must be unique
@@ -150,7 +151,7 @@ The below rules are being migrated to Respect:
150
151
-[no-x-security-scheme-name-without-openapi](./respect/no-x-security-scheme-name-without-openapi.md): the `x-security` can't use `schemeName` when Step request is described with `x-operation`.
151
152
-[respect-supported-versions](./respect/respect-supported-versions.md): the `version` property must be one of the supported values.
152
153
-[x-security-scheme-name-reference](./respect/x-security-scheme-name-reference.md): when multiple `sourceDescriptions` exist, `workflow.x-security.schemeName` must reference a source description (for example, `$sourceDescriptions.{name}.schemeName`)
153
-
-[x-security-scheme-required-values](./respect/x-security-scheme-required-values.md) validate that `x-security` have all required `values` described according to the used `scheme`.
154
+
-[x-security-scheme-required-values](./respect/x-security-scheme-required-values.md): validate that `x-security` have all required `values` described according to the used `scheme`.
154
155
155
156
## Open-RPC rules
156
157
@@ -159,8 +160,8 @@ Use the rules in this section for Open-RPC specific linting.
159
160
-[struct](./common/struct.md): Conform to the declared Open-RPC specification version
160
161
-[no-unresolved-refs](./common/no-unresolved-refs.md): Every `$ref` must exist
161
162
-[no-unused-components](./oas/no-unused-components.md): All components must be used
162
-
-`spec-no-duplicated-method-params`: The list of parameters must not include duplicated parameters
163
-
-`spec-no-required-params-after-optional`: Required parameters must be positioned before optional parameters
163
+
-[spec-no-duplicated-method-params](./openrpc/spec-no-duplicated-method-params.md): The list of parameters must not include duplicated parameters
164
+
-[spec-no-required-params-after-optional](./openrpc/spec-no-required-params-after-optional.md): Required parameters must be positioned before optional parameters
164
165
-[info-contact](./oas/info-contact.md): Contact section is defined under `info`
165
166
-[info-license](./oas/info-license.md): License section is defined under `info`
| severity | string | Possible values: `off`, `warn`, `error`. Default `off` (in `recommended` and `minimal` configurations). |
25
+
| order | string[]| Ordered list of allowed HTTP method names. Operations on a path must follow this order. Default: `get`, `head`, `post`, `put`, `patch`, `delete`, `options`, `query`, `trace`. |
26
+
27
+
An example configuration:
28
+
29
+
```yaml
30
+
rules:
31
+
path-http-verbs-order: error
32
+
```
33
+
34
+
Custom order:
35
+
36
+
```yaml
37
+
rules:
38
+
path-http-verbs-order:
39
+
severity: error
40
+
order:
41
+
- get
42
+
- post
43
+
- put
44
+
- patch
45
+
- delete
46
+
```
47
+
48
+
## Examples
49
+
50
+
With `path-http-verbs-order: error`, declaring `post` before `get` on the same path is reported because the default order expects `get` first.
0 commit comments