Skip to content

Commit 7b786e8

Browse files
committed
docs(@v2): fix Arazzo rule IDs, add path-http-verbs-order and Open-RPC rule pages
Made-with: Cursor
1 parent ad0e99b commit 7b786e8

9 files changed

+140
-21
lines changed

docs/@v2/rules/arazzo/sourceDescriptions-name-unique.md renamed to docs/@v2/rules/arazzo/sourceDescription-name-unique.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sourceDescriptions-name-unique
1+
# sourceDescription-name-unique
22

33
The `name` property of the Source Description object must be unique across all source descriptions.
44

@@ -21,7 +21,7 @@ An example configuration:
2121

2222
```yaml
2323
rules:
24-
sourceDescriptions-name-unique: error
24+
sourceDescription-name-unique: error
2525
```
2626
2727
## Examples
@@ -30,7 +30,7 @@ Given the following configuration:
3030
3131
```yaml
3232
rules:
33-
sourceDescriptions-name-unique: error
33+
sourceDescription-name-unique: error
3434
```
3535
3636
Example of a **correct** `sourceDescriptions` list:
@@ -47,7 +47,7 @@ sourceDescriptions:
4747

4848
## Related rules
4949

50-
- [sourceDescription-type](./sourceDescriptions-type.md)
50+
- [sourceDescription-type](./sourceDescription-type.md)
5151

5252
## Resources
5353

docs/@v2/rules/arazzo/sourceDescriptions-type.md renamed to docs/@v2/rules/arazzo/sourceDescription-type.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sourceDescriptions-type
1+
# sourceDescription-type
22

33
The `type` property of the Source Description object must be either `openapi` or `arazzo`.
44

@@ -21,7 +21,7 @@ An example configuration:
2121

2222
```yaml
2323
rules:
24-
sourceDescriptions-type: error
24+
sourceDescription-type: error
2525
```
2626
2727
## Examples
@@ -30,7 +30,7 @@ Given the following configuration:
3030
3131
```yaml
3232
rules:
33-
sourceDescriptions-type: error
33+
sourceDescription-type: error
3434
```
3535
3636
Example of a **correct** `sourceDescriptions` list:
@@ -47,7 +47,7 @@ sourceDescriptions:
4747

4848
## Related rules
4949

50-
- [sourceDescription-name-unique](./sourceDescriptions-name-unique.md)
50+
- [sourceDescription-name-unique](./sourceDescription-name-unique.md)
5151

5252
## Resources
5353

docs/@v2/rules/built-in-rules.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ The rules list is split into sections.
6060
### Parameters
6161

6262
- [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")
6464
- [no-invalid-parameter-examples](./oas/no-invalid-parameter-examples.md): Parameter examples must match declared schema types
6565
- [operation-parameters-unique](./oas/operation-parameters-unique.md): No repeated parameter names within an operation
6666
- [parameter-description](./oas/parameter-description.md): Parameters must all have descriptions
@@ -72,14 +72,15 @@ The rules list is split into sections.
7272

7373
- [no-ambiguous-paths](./oas/no-ambiguous-paths.md): No path can match more than one PathItem entry, including template variables
7474
- [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
7576
- [no-identical-paths](./oas/no-identical-paths.md): Paths cannot be identical, including template variables
7677
- [no-path-trailing-slash](./oas/no-path-trailing-slash.md): No trailing slashes on paths
7778
- [path-segment-plural](./oas/path-segment-plural.md): All URL segments in a path must be plural (exceptions can be configured)
7879
- [paths-kebab-case](./oas/paths-kebab-case.md): Paths must be in `kebab-case` format
7980

8081
### Requests, Responses, and Schemas
8182

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
8384
- [no-enum-type-mismatch](./common/no-enum-type-mismatch.md): Enum options must match the data type declared in the schema
8485
- [no-example-value-and-externalValue](./oas/no-example-value-and-externalValue.md): Either the `value` or `externalValue` may be present, but not both
8586
- [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
132133
- [outputs-defined](./arazzo/outputs-defined.md): the output value should be defined before usage
133134
- [parameters-unique](./arazzo/parameters-unique.md): the `parameters` list must not include duplicate parameters
134135
- [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`
137138
- [stepId-unique](./arazzo/stepId-unique.md): the `stepId` must be unique amongst all steps described in the workflow
138139
- [step-onFailure-unique](./arazzo/step-onFailure-unique.md): the `onFailure` actions of the `step` object must be unique
139140
- [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:
150151
- [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`.
151152
- [respect-supported-versions](./respect/respect-supported-versions.md): the `version` property must be one of the supported values.
152153
- [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`.
154155

155156
## Open-RPC rules
156157

@@ -159,8 +160,8 @@ Use the rules in this section for Open-RPC specific linting.
159160
- [struct](./common/struct.md): Conform to the declared Open-RPC specification version
160161
- [no-unresolved-refs](./common/no-unresolved-refs.md): Every `$ref` must exist
161162
- [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
164165
- [info-contact](./oas/info-contact.md): Contact section is defined under `info`
165166
- [info-license](./oas/info-license.md): License section is defined under `info`
166167

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
slug: /docs/cli/rules/oas/path-http-verbs-order
3+
---
4+
5+
# path-http-verbs-order
6+
7+
Requires HTTP operations on each path item to appear in a consistent order.
8+
9+
| OAS | Compatibility |
10+
| --- | ------------- |
11+
| 2.0 ||
12+
| 3.0 ||
13+
| 3.1 ||
14+
| 3.2 ||
15+
16+
## API design principles
17+
18+
Keeping verbs in a predictable order (for example `get` before `post`) makes specs easier to scan and aligns with common style guides.
19+
20+
## Configuration
21+
22+
| Option | Type | Description |
23+
| -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
24+
| 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.
51+
52+
## Resources
53+
54+
- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/common/path-http-verbs-order.ts)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
slug: /docs/cli/rules/openrpc/spec-no-duplicated-method-params
3+
---
4+
5+
# spec-no-duplicated-method-params
6+
7+
Each method's `params` list must not contain more than one parameter with the same `name`.
8+
9+
| Open-RPC | Compatibility |
10+
| -------- | ------------- |
11+
| 1.x ||
12+
13+
## API design principles
14+
15+
Duplicate parameter names make it unclear which definition applies and can break tooling that indexes parameters by name.
16+
17+
## Configuration
18+
19+
| Option | Type | Description |
20+
| -------- | ------ | ------------------------------------------------------------------------------------ |
21+
| severity | string | Possible values: `off`, `warn`, `error`. Default `error` (in `recommended` ruleset). |
22+
23+
```yaml
24+
rules:
25+
spec-no-duplicated-method-params: error
26+
```
27+
28+
## Resources
29+
30+
- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/openrpc/spec-no-duplicated-method-params.ts)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
slug: /docs/cli/rules/openrpc/spec-no-required-params-after-optional
3+
---
4+
5+
# spec-no-required-params-after-optional
6+
7+
Required parameters must appear before any optional parameters in each method's `params` list.
8+
9+
| Open-RPC | Compatibility |
10+
| -------- | ------------- |
11+
| 1.x ||
12+
13+
## API design principles
14+
15+
Placing required parameters after optional ones matches common RPC and Open-RPC conventions and avoids ambiguous positional calling patterns.
16+
17+
## Configuration
18+
19+
| Option | Type | Description |
20+
| -------- | ------ | ------------------------------------------------------------------------------------ |
21+
| severity | string | Possible values: `off`, `warn`, `error`. Default `error` (in `recommended` ruleset). |
22+
23+
```yaml
24+
rules:
25+
spec-no-required-params-after-optional: error
26+
```
27+
28+
## Resources
29+
30+
- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/openrpc/spec-no-required-params-after-optional.ts)

docs/@v2/rules/recommended.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ Errors:
2929
- [path-not-include-query](./oas/path-not-include-query.md)
3030
- [path-parameters-defined](./oas/path-parameters-defined.md)
3131
- [security-defined](./oas/security-defined.md)
32-
- [sourceDescription-name-unique](./arazzo/sourceDescriptions-name-unique.md)
33-
- [sourceDescription-type](./arazzo/sourceDescriptions-type.md)
32+
- [sourceDescription-name-unique](./arazzo/sourceDescription-name-unique.md)
33+
- [sourceDescription-type](./arazzo/sourceDescription-type.md)
3434
- [sourceDescriptions-not-empty](./arazzo/sourceDescriptions-not-empty.md)
3535
- [spec-components-invalid-map-name](./oas/spec-components-invalid-map-name.md)
3636
- [spec-example-values](./oas/spec-example-values.md)

docs/@v2/rules/spec-ruleset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ All the rules are of severity `error`:
2323
- [path-not-include-query](./oas/path-not-include-query.md)
2424
- [path-parameters-defined](./oas/path-parameters-defined.md)
2525
- [requestBody-replacements-unique](./arazzo/requestBody-replacements-unique.md)
26-
- [sourceDescription-name-unique](./arazzo/sourceDescriptions-name-unique.md)
27-
- [sourceDescription-type](./arazzo/sourceDescriptions-type.md)
26+
- [sourceDescription-name-unique](./arazzo/sourceDescription-name-unique.md)
27+
- [sourceDescription-type](./arazzo/sourceDescription-type.md)
2828
- [sourceDescriptions-not-empty](./arazzo/sourceDescriptions-not-empty.md)
2929
- [spec-components-invalid-map-name](./oas/spec-components-invalid-map-name.md)
3030
- [spec-discriminator-defaultMapping](./oas/spec-discriminator-defaultMapping.md)

docs/@v2/v2.sidebars.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
- page: rules/oas/operation-tag-defined.md
133133
- page: rules/oas/parameter-description.md
134134
- page: rules/oas/path-declaration-must-exist.md
135+
- page: rules/oas/path-http-verbs-order.md
135136
- page: rules/oas/path-not-include-query.md
136137
- page: rules/oas/path-parameters-defined.md
137138
- page: rules/oas/path-segment-plural.md
@@ -150,6 +151,9 @@
150151
- separator: AsyncAPI
151152
- page: rules/async/channels-kebab-case.md
152153
- page: rules/async/no-channel-trailing-slash.md
154+
- separator: Open-RPC
155+
- page: rules/openrpc/spec-no-duplicated-method-params.md
156+
- page: rules/openrpc/spec-no-required-params-after-optional.md
153157
- separator: Arazzo
154158
- page: rules/respect/no-criteria-xpath.md
155159
- page: rules/respect/respect-supported-versions.md
@@ -160,8 +164,8 @@
160164
- page: rules/arazzo/criteria-unique.md
161165
- page: rules/arazzo/parameters-unique.md
162166
- page: rules/arazzo/requestBody-replacements-unique.md
163-
- page: rules/arazzo/sourceDescriptions-name-unique.md
164-
- page: rules/arazzo/sourceDescriptions-type.md
167+
- page: rules/arazzo/sourceDescription-name-unique.md
168+
- page: rules/arazzo/sourceDescription-type.md
165169
- page: rules/arazzo/stepId-unique.md
166170
- page: rules/arazzo/step-onFailure-unique.md
167171
- page: rules/arazzo/step-onSuccess-unique.md

0 commit comments

Comments
 (0)