Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sourceDescriptions-name-unique
# sourceDescription-name-unique

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

Expand All @@ -21,7 +21,7 @@ An example configuration:

```yaml
rules:
sourceDescriptions-name-unique: error
sourceDescription-name-unique: error
```

## Examples
Expand All @@ -30,7 +30,7 @@ Given the following configuration:

```yaml
rules:
sourceDescriptions-name-unique: error
sourceDescription-name-unique: error
```

Example of a **correct** `sourceDescriptions` list:
Expand All @@ -47,7 +47,7 @@ sourceDescriptions:

## Related rules

- [sourceDescription-type](./sourceDescriptions-type.md)
- [sourceDescription-type](./sourceDescription-type.md)

## Resources

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# sourceDescriptions-type
# sourceDescription-type

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

Expand All @@ -21,7 +21,7 @@ An example configuration:

```yaml
rules:
sourceDescriptions-type: error
sourceDescription-type: error
```

## Examples
Expand All @@ -30,7 +30,7 @@ Given the following configuration:

```yaml
rules:
sourceDescriptions-type: error
sourceDescription-type: error
```

Example of a **correct** `sourceDescriptions` list:
Expand All @@ -47,7 +47,7 @@ sourceDescriptions:

## Related rules

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

## Resources

Expand Down
15 changes: 8 additions & 7 deletions docs/@v2/rules/built-in-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ The rules list is split into sections.
### Parameters

- [array-parameter-serialization](./oas/array-parameter-serialization.md): Require `style` and `explode` for parameters with array type
- [boolean-parameter-prefixes](./oas/boolean-parameter-prefixes.md): All boolean paramater names start with a particular prefix (such as "is")
- [boolean-parameter-prefixes](./oas/boolean-parameter-prefixes.md): All boolean parameter names start with a particular prefix (such as "is")
- [no-invalid-parameter-examples](./oas/no-invalid-parameter-examples.md): Parameter examples must match declared schema types
- [operation-parameters-unique](./oas/operation-parameters-unique.md): No repeated parameter names within an operation
- [parameter-description](./oas/parameter-description.md): Parameters must all have descriptions
Expand All @@ -72,14 +72,15 @@ The rules list is split into sections.

- [no-ambiguous-paths](./oas/no-ambiguous-paths.md): No path can match more than one PathItem entry, including template variables
- [no-http-verbs-in-paths](./oas/no-http-verbs-in-paths.md): Verbs like "get" cannot be used in paths
- [path-http-verbs-order](./oas/path-http-verbs-order.md): HTTP operations on each path must follow a configured verb order
- [no-identical-paths](./oas/no-identical-paths.md): Paths cannot be identical, including template variables
- [no-path-trailing-slash](./oas/no-path-trailing-slash.md): No trailing slashes on paths
- [path-segment-plural](./oas/path-segment-plural.md): All URL segments in a path must be plural (exceptions can be configured)
- [paths-kebab-case](./oas/paths-kebab-case.md): Paths must be in `kebab-case` format

### Requests, Responses, and Schemas

- [component-name-unique](./oas/component-name-unique.md): Check for schema-wide unqiue naming of parameters, schemas, request bodies and responses
- [component-name-unique](./oas/component-name-unique.md): Check for schema-wide unique naming of parameters, schemas, request bodies and responses
- [no-enum-type-mismatch](./common/no-enum-type-mismatch.md): Enum options must match the data type declared in the schema
- [no-example-value-and-externalValue](./oas/no-example-value-and-externalValue.md): Either the `value` or `externalValue` may be present, but not both
- [no-invalid-media-type-examples](./oas/no-invalid-media-type-examples.md): Example request bodies must match the declared schema
Expand Down Expand Up @@ -132,8 +133,8 @@ Within the Arazzo family of rules, there are rules for the main Arazzo specifica
- [outputs-defined](./arazzo/outputs-defined.md): the output value should be defined before usage
- [parameters-unique](./arazzo/parameters-unique.md): the `parameters` list must not include duplicate parameters
- [requestBody-replacements-unique](./arazzo/requestBody-replacements-unique.md): the `replacements` of the `requestBody` object must be unique
- [sourceDescriptions-name-unique](./arazzo/sourceDescriptions-name-unique.md): the `name` property of the `sourceDescription` object must be unique across all source descriptions
- [sourceDescriptions-type](./arazzo/sourceDescriptions-type.md): the `type` property of the `sourceDescription` object must be either `openapi` or `arazzo`
- [sourceDescription-name-unique](./arazzo/sourceDescription-name-unique.md): the `name` property of the `sourceDescription` object must be unique across all source descriptions
- [sourceDescription-type](./arazzo/sourceDescription-type.md): the `type` property of the `sourceDescription` object must be either `openapi` or `arazzo`
- [stepId-unique](./arazzo/stepId-unique.md): the `stepId` must be unique amongst all steps described in the workflow
- [step-onFailure-unique](./arazzo/step-onFailure-unique.md): the `onFailure` actions of the `step` object must be unique
- [step-onSuccess-unique](./arazzo/step-onSuccess-unique.md): the `onSuccess` actions of the `step` object must be unique
Expand All @@ -150,7 +151,7 @@ The below rules are being migrated to Respect:
- [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`.
- [respect-supported-versions](./respect/respect-supported-versions.md): the `version` property must be one of the supported values.
- [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`)
- [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`.
- [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`.

## Open-RPC rules

Expand All @@ -159,8 +160,8 @@ Use the rules in this section for Open-RPC specific linting.
- [struct](./common/struct.md): Conform to the declared Open-RPC specification version
- [no-unresolved-refs](./common/no-unresolved-refs.md): Every `$ref` must exist
- [no-unused-components](./oas/no-unused-components.md): All components must be used
- `spec-no-duplicated-method-params`: The list of parameters must not include duplicated parameters
- `spec-no-required-params-after-optional`: Required parameters must be positioned before optional parameters
- [spec-no-duplicated-method-params](./openrpc/spec-no-duplicated-method-params.md): The list of parameters must not include duplicated parameters
- [spec-no-required-params-after-optional](./openrpc/spec-no-required-params-after-optional.md): Required parameters must be positioned before optional parameters
- [info-contact](./oas/info-contact.md): Contact section is defined under `info`
- [info-license](./oas/info-license.md): License section is defined under `info`

Expand Down
54 changes: 54 additions & 0 deletions docs/@v2/rules/oas/path-http-verbs-order.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
slug: /docs/cli/rules/oas/path-http-verbs-order
---

# path-http-verbs-order

Requires HTTP operations on each path item to appear in a consistent order.

| OAS | Compatibility |
| --- | ------------- |
| 2.0 | ✅ |
| 3.0 | ✅ |
| 3.1 | ✅ |
| 3.2 | ✅ |

## API design principles

Keeping verbs in a predictable order (for example `get` before `post`) makes specs easier to scan and aligns with common style guides.

## Configuration

| Option | Type | Description |
| -------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| severity | string | Possible values: `off`, `warn`, `error`. Default `off` (in `recommended` and `minimal` configurations). |
| 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`. |

An example configuration:

```yaml
rules:
path-http-verbs-order: error
```

Custom order:

```yaml
rules:
path-http-verbs-order:
severity: error
order:
- get
- post
- put
- patch
- delete
```

## Examples

With `path-http-verbs-order: error`, declaring `post` before `get` on the same path is reported because the default order expects `get` first.

## Resources

- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/common/path-http-verbs-order.ts)
30 changes: 30 additions & 0 deletions docs/@v2/rules/openrpc/spec-no-duplicated-method-params.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
slug: /docs/cli/rules/openrpc/spec-no-duplicated-method-params
---

# spec-no-duplicated-method-params

Each method's `params` list must not contain more than one parameter with the same `name`.

| Open-RPC | Compatibility |
| -------- | ------------- |
| 1.x | ✅ |

## API design principles

Duplicate parameter names make it unclear which definition applies and can break tooling that indexes parameters by name.

## Configuration

| Option | Type | Description |
| -------- | ------ | ------------------------------------------------------------------------------------ |
| severity | string | Possible values: `off`, `warn`, `error`. Default `error` (in `recommended` ruleset). |

```yaml
rules:
spec-no-duplicated-method-params: error
```

## Resources

- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/openrpc/spec-no-duplicated-method-params.ts)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
slug: /docs/cli/rules/openrpc/spec-no-required-params-after-optional
---

# spec-no-required-params-after-optional

Required parameters must appear before any optional parameters in each method's `params` list.

| Open-RPC | Compatibility |
| -------- | ------------- |
| 1.x | ✅ |

## API design principles

Placing required parameters after optional ones matches common RPC and Open-RPC conventions and avoids ambiguous positional calling patterns.

## Configuration

| Option | Type | Description |
| -------- | ------ | ------------------------------------------------------------------------------------ |
| severity | string | Possible values: `off`, `warn`, `error`. Default `error` (in `recommended` ruleset). |

```yaml
rules:
spec-no-required-params-after-optional: error
```

## Resources

- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/openrpc/spec-no-required-params-after-optional.ts)
4 changes: 2 additions & 2 deletions docs/@v2/rules/recommended.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ Errors:
- [path-not-include-query](./oas/path-not-include-query.md)
- [path-parameters-defined](./oas/path-parameters-defined.md)
- [security-defined](./oas/security-defined.md)
- [sourceDescription-name-unique](./arazzo/sourceDescriptions-name-unique.md)
- [sourceDescription-type](./arazzo/sourceDescriptions-type.md)
- [sourceDescription-name-unique](./arazzo/sourceDescription-name-unique.md)
- [sourceDescription-type](./arazzo/sourceDescription-type.md)
- [sourceDescriptions-not-empty](./arazzo/sourceDescriptions-not-empty.md)
- [spec-components-invalid-map-name](./oas/spec-components-invalid-map-name.md)
- [spec-example-values](./oas/spec-example-values.md)
Expand Down
4 changes: 2 additions & 2 deletions docs/@v2/rules/spec-ruleset.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ All the rules are of severity `error`:
- [path-not-include-query](./oas/path-not-include-query.md)
- [path-parameters-defined](./oas/path-parameters-defined.md)
- [requestBody-replacements-unique](./arazzo/requestBody-replacements-unique.md)
- [sourceDescription-name-unique](./arazzo/sourceDescriptions-name-unique.md)
- [sourceDescription-type](./arazzo/sourceDescriptions-type.md)
- [sourceDescription-name-unique](./arazzo/sourceDescription-name-unique.md)
- [sourceDescription-type](./arazzo/sourceDescription-type.md)
- [sourceDescriptions-not-empty](./arazzo/sourceDescriptions-not-empty.md)
- [spec-components-invalid-map-name](./oas/spec-components-invalid-map-name.md)
- [spec-discriminator-defaultMapping](./oas/spec-discriminator-defaultMapping.md)
Expand Down
8 changes: 6 additions & 2 deletions docs/@v2/v2.sidebars.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@
- page: rules/oas/operation-tag-defined.md
- page: rules/oas/parameter-description.md
- page: rules/oas/path-declaration-must-exist.md
- page: rules/oas/path-http-verbs-order.md
- page: rules/oas/path-not-include-query.md
- page: rules/oas/path-parameters-defined.md
- page: rules/oas/path-segment-plural.md
Expand All @@ -150,6 +151,9 @@
- separator: AsyncAPI
- page: rules/async/channels-kebab-case.md
- page: rules/async/no-channel-trailing-slash.md
- separator: Open-RPC
- page: rules/openrpc/spec-no-duplicated-method-params.md
- page: rules/openrpc/spec-no-required-params-after-optional.md
- separator: Arazzo
- page: rules/respect/no-criteria-xpath.md
- page: rules/respect/respect-supported-versions.md
Expand All @@ -160,8 +164,8 @@
- page: rules/arazzo/criteria-unique.md
- page: rules/arazzo/parameters-unique.md
- page: rules/arazzo/requestBody-replacements-unique.md
- page: rules/arazzo/sourceDescriptions-name-unique.md
- page: rules/arazzo/sourceDescriptions-type.md
- page: rules/arazzo/sourceDescription-name-unique.md
- page: rules/arazzo/sourceDescription-type.md
- page: rules/arazzo/stepId-unique.md
- page: rules/arazzo/step-onFailure-unique.md
- page: rules/arazzo/step-onSuccess-unique.md
Expand Down
Loading