Skip to content

Commit

Permalink
chore: add arazzo rules documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitryAnansky committed Aug 30, 2024
1 parent 102ca9e commit d209f56
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 4 deletions.
95 changes: 95 additions & 0 deletions docs/rules/arazzo/parameters-unique.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
slug: /docs/cli/rules/arazzo/parameters-unique
---

# parameters-unique

Requires the `parameters` list not to include duplicate parameters.

| ARAZZO | Compatibility |
| ------ | ------------- |
| 1.0.0 ||

```mermaid
flowchart TD
Root ==> workflows --> workflow --> parameters
style Contact fill:#codaf9,stroke:#0044d4,stroke-width:5px
```

```mermaid
flowchart TD
Root ==> x-parameters
style Contact fill:#codaf9,stroke:#0044d4,stroke-width:5px
```

```mermaid
flowchart TD
Root ==> workflows --> workflow --> steps --> step --> parameters
style Contact fill:#codaf9,stroke:#0044d4,stroke-width:5px
```

## API design principles

A list of `parameters` that are applicable for step or all steps described under workflow should not be duplicated to avoid shallow parameter override.

## Configuration

| Option | Type | Description |
| -------- | ------ | ------------------------------------------------------- |
| severity | string | Possible values: `off`, `warn`, `error`. Default `off`. |

An example configuration:

```yaml
arazzoRules:
parameters-unique: error
```
## Examples
Given the following configuration:
```yaml
arazzoRules:
parameters-unique: error
```
Example of an **incorrect** license:
```yaml Object example
workflows:
- workflowId: get-museum-hours
parameters:
- in: header
name: Authorization
value: Main Og==
- in: header
name: Authorization
value: Basic Og==
```
Example of a **correct** license:
```yaml Object example
workflows:
- workflowId: get-museum-hours
parameters:
- in: header
name: Authorization
value: Basic Og==
- in: header
name: Auth
value: Main Og==
```
## Related rules
## Resources
- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/arazzo/parameters-unique.ts)
1 change: 1 addition & 0 deletions docs/rules/recommended.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ Errors:
- [security-defined](./security-defined.md)
- [spec-components-invalid-map-name](./spec-components-invalid-map-name.md)
- [spec](./spec.md)
- [parameters-unique](./arazzo/parameters-unique.md)

Warnings:

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/spot/parameters-not-in-body.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /docs/cli/rules/spot/parameters-not-in-body
Requires the `in` section inside `parameters` must not contain a `body`.

| ARAZZO | Compatibility |
|--------| ------------- |
| ------ | ------------- |
| 1.0.0 ||

```mermaid
Expand Down
5 changes: 2 additions & 3 deletions docs/rules/spot/version-enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ slug: /docs/cli/rules/spot/version-enum
Requires the `version` property must be one of the supported values.

| ARAZZO | Compatibility |
|--------| ------------- |
| ------ | ------------- |
| 1.0.0 ||

```mermaid
Expand All @@ -21,7 +21,7 @@ style Contact fill:#codaf9,stroke:#0044d4,stroke-width:5px
## API design principles

This is `Spot` specific rule.
The `version` property must be one of the supported values witch is might be different to the `Arazzo` latest versions.
The `version` property must be one of the supported values witch is might be different to the `Arazzo` latest versions.

## Configuration

Expand Down Expand Up @@ -64,4 +64,3 @@ arazzo: 1.0.0
## Resources
- [Rule source](https://github.com/Redocly/redocly-cli/blob/main/packages/core/src/rules/spot/version-enum.ts)

0 comments on commit d209f56

Please sign in to comment.