Skip to content

Commit bb27e7e

Browse files
authored
docs: update docs to include OAS 3.2 (#2351)
1 parent d8b30e6 commit bb27e7e

File tree

69 files changed

+168
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+168
-47
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ Steps to reproduce the behavior:
2929
**OpenAPI description**
3030

3131
<!-- If applicable, add an OpenAPI description and `redocly.yaml` configuration file that helps reproduce the problem.
32-
At a minimum, please state the specification version(s) you're using (e.g. 2.0, 3.0, 3.1). -->
32+
At a minimum, please state the specification and version(s) you're using. -->
3333

3434
**Redocly Version(s)**
3535

3636
<!-- What version of Redocly CLI are you using? -->
3737

3838
**`Node.js` Version(s)**
3939

40-
<!-- What version of `node.js` are you using? -->
40+
<!-- What version of `node.js` and `npm` are you using? -->
4141

4242
**OS, environment**
4343

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[@Redocly](https://redocly.com) CLI is your all-in-one OpenAPI utility.
44
It builds, manages, improves, and quality-checks your OpenAPI descriptions, all of which comes in handy for various phases of the API Lifecycle.
55
Create your own rulesets to make API governance easy, publish beautiful API reference documentation, and more.
6-
Supports OpenAPI 3.1, 3.0 and OpenAPI 2.0 (legacy Swagger), AsyncAPI 3.0 and 2.6, Arazzo 1.0.
6+
Supports OpenAPI 3.2, 3.1, 3.0 and OpenAPI 2.0 (legacy Swagger), AsyncAPI 3.0 and 2.6, Arazzo 1.0.
77

88
![build and test](https://github.com/redocly/redocly-cli/actions/workflows/tests.yaml/badge.svg)
99
![npm (scoped)](https://img.shields.io/npm/v/@redocly/cli)

docs/@v2/api-standards.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,22 @@ seo:
55

66
# API standards and governance
77

8-
In APIs, making sure that an API meets certain standard behaviors, and continues to meet them even as it evolves, is really important. Most API providers use tooling to ensure that their APIs have all the features they expect of them - and that their users expect too.
8+
In APIs, making sure that an API meets certain standard behaviors, and continues to meet them even as it evolves, is really important.
9+
Most API providers use tooling to ensure that their APIs have all the features they expect of them - and that their users expect too.
910

10-
This can be simple API consistency, such as whether resource names should use `kebab-case` or `camelCase` in URLs, or whether any error described contains the expected fields. It can be user-centric, making sure that the documentation is thorough and includes descriptions for all endpoints, or example values for all parameters. For some organizations, security is vital and API governance and linting tools can check that every endpoint has security rules designed for it.
11+
This can be simple API consistency, such as whether resource names should use `kebab-case` or `camelCase` in URLs, or whether any error described contains the expected fields.
12+
It can be user-centric, making sure that the documentation is thorough and includes descriptions for all endpoints, or example values for all parameters.
13+
For some organizations, security is vital and API governance and linting tools can check that every endpoint has security rules designed for it.
1114

1215
## Ensure compliance with API linting
1316

14-
Redocly offers linting to make sure that an OpenAPI description matches the expected standards. It's available in the Redocly CLI tool and in our hosted platform. Both tools share a common configuration so you can use the same setup for both environments.
17+
Redocly offers linting to make sure that an OpenAPI description matches the expected standards.
18+
It's available in the Redocly CLI tool and in our hosted platform.
19+
Both tools share a common configuration so you can use the same setup for both environments.
1520

16-
Choose between one of the existing rulesets, or compile your own. There are some built-in rules for common use cases, and configurable rules for when you need to express something specific to your use case. For advanced users, you can also create your own rules by building custom plugins with Javascript.
21+
Choose between one of the existing rulesets, or compile your own.
22+
There are some built-in rules for common use cases, and configurable rules for when you need to express something specific to your use case.
23+
For advanced users, you can also create your own rules by building custom plugins with Javascript.
1724

1825
Once the ruleset is created, use it with your API and Redocly in any or all of these ways:
1926

docs/@v2/commands/build-docs.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
The `build-docs` command builds Redoc into an HTML file that contains your API documentation.
66
The standalone HTML file can be easily shared or hosted on a platform of your choice.
77

8+
{% admonition type="warning" name="OpenAPI only" %}
9+
The `build-docs` command currently supports only Swagger 2.0 and OpenAPI 3.0/3.1 descriptions.
10+
Support for OpenAPI 3.2 is coming soon.
11+
{% /admonition %}
12+
813
## Usage
914

1015
```bash
@@ -63,12 +68,14 @@ You can generate a build by including the API name with the command, as shown in
6368
redocly build-docs games@v1
6469
```
6570

66-
In this case, after resolving the path behind the `games@v1` name, `build-docs` generates a build of the `api-description.json` file. For this approach, the Redocly configuration file is mandatory.
71+
In this case, after resolving the path behind the `games@v1` name, `build-docs` generates a build of the `api-description.json` file.
72+
For this approach, the Redocly configuration file is mandatory.
6773
Any additional configurations provided in the file are also used by the command.
6874

6975
### Use an alternative configuration file
7076

71-
By default, the CLI tool looks for the [Redocly configuration file](../configuration/index.md) in the current working directory. Use the optional `--config` argument to provide an alternative path to a configuration file.
77+
By default, the CLI tool looks for the [Redocly configuration file](../configuration/index.md) in the current working directory.
78+
Use the optional `--config` argument to provide an alternative path to a configuration file.
7279

7380
```bash
7481
redocly build-docs --config=./another/directory/config.yaml

docs/@v2/commands/bundle.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,16 @@
22

33
## Introduction
44

5-
API descriptions can grow and become difficult to manage, especially if several teams are collaborating on them. It's a good practice to maintain the reusable parts as separate files, and include them in the main (root) API description by referencing them with `$ref`. However, most OpenAPI tools don't support that multi-file approach, and require a single-file API description.
5+
API descriptions can grow and become difficult to manage, especially if several teams are collaborating on them.
6+
It's a good practice to maintain the reusable parts as separate files, and include them in the main (root) API description by referencing them with `$ref`.
7+
However, most OpenAPI tools don't support that multi-file approach, and require a single-file API description.
68

7-
Redocly CLI can help you combine separate API description files (such as if you used the [`split`](./split.md) command) into one. The `bundle` command pulls the relevant parts of an API description into a single file output in JSON or YAML format.
9+
Redocly CLI can help you combine separate API description files (such as if you used the [`split`](./split.md) command) into one.
10+
The `bundle` command pulls the relevant parts of an API description into a single file output in JSON or YAML format.
811

9-
The `bundle` command differs from the [`join`](./join.md) command. The `bundle` command takes a root OpenAPI file as input and follows the `$ref` mentions to include all the referenced components into a single output file. The `join` command can combine multiple OpenAPI files into a single unified API description file.
12+
The `bundle` command differs from the [`join`](./join.md) command.
13+
The `bundle` command takes a root OpenAPI file as input and follows the `$ref` mentions to include all the referenced components into a single output file.
14+
The `join` command can combine multiple OpenAPI files into a single unified API description file.
1015

1116
The `bundle` command first executes preprocessors, then rules, then decorators.
1217

docs/@v2/commands/completion.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Introduction
44

5-
The `completion` command generates the scripts to add autocompletion to your bash or zsh shell. This addition is a handy productivity boost if you regularly use `redocly` from the command line.
5+
The `completion` command generates the scripts to add autocompletion to your bash or zsh shell.
6+
This addition is a handy productivity boost if you regularly use `redocly` from the command line.
67

78
## Usage
89

docs/@v2/commands/join.md

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,33 @@
33
## Introduction
44

55
{% admonition type="warning" name="Important" %}
6-
The `join` command is considered an experimental feature. This means it's still a work in progress and may go through major changes.
6+
The `join` command is considered an experimental feature.
7+
This means it's still a work in progress and may go through major changes.
78

89
The `join` command supports OpenAPI 3.x descriptions only.
910
{% /admonition %}
1011

11-
Maintainers of multiple API descriptions can benefit from storing each endpoint as a standalone API description file. However, this approach is not supported by the majority of OpenAPI tools, as they require a single API description file. With Redocly CLI, you can solve this problem by using the `join` command to combine two or more API description files into a single one.
12+
Maintainers of multiple API descriptions can benefit from storing each endpoint as a standalone API description file.
13+
However, this approach is not supported by the majority of OpenAPI tools, as they require a single API description file.
14+
With Redocly CLI, you can solve this problem by using the `join` command to combine two or more API description files into a single one.
1215

13-
The `join` command differs from the [`bundle`](./bundle.md) command. The `bundle` command takes a root OpenAPI file as input and follows the `$ref` mentions to include all the referenced components into a single output file. The `join` command can combine multiple OpenAPI files into a single unified API description file.
16+
The `join` command differs from the [`bundle`](./bundle.md) command.
17+
The `bundle` command takes a root OpenAPI file as input and follows the `$ref` mentions to include all the referenced components into a single output file.
18+
The `join` command can combine multiple OpenAPI files into a single unified API description file.
19+
Unlike the `bundle` command, `join` does not execute preprocessors or decorators and combines the API description files as-is without modifying the original source files.
1420

1521
To easily distinguish the origin of OpenAPI objects and properties, you can optionally instruct the `join` command to prepend custom prefixes to them.
1622

17-
The `join` command accepts both YAML and JSON files, which you can mix in the resulting `openapi.yaml` or `openapi.json` file. Setting a custom name and extension for this file can be achieved by providing it through the `--output` argument. Any existing file is overwritten. If the `--output` option is not provided, the command uses the extension of the first entry point file.
23+
The `join` command accepts both YAML and JSON files, which you can mix in the resulting `openapi.yaml` or `openapi.json` file.
24+
Setting a custom name and extension for this file can be achieved by providing it through the `--output` argument.
25+
Any existing file is overwritten.
26+
If the `--output` option is not provided, the command uses the extension of the first entry point file.
1827

19-
Apart from providing individual API description files as the input, you can also specify the path to a folder that contains multiple API description files and match them with a wildcard (for example, `myproject/openapi/*.(yaml/json)`). The `join` command collects all matching files and combines them into one file.
28+
Apart from providing individual API description files as the input, you can also specify the path to a folder that contains multiple API description files and match them with a wildcard (for example, `myproject/openapi/*.(yaml/json)`).
29+
The `join` command collects all matching files and combines them into one file.
2030

2131
We recommend running [`lint`](./lint.md) before joining API descriptions to ensure that they are valid and meet the expected standards.
22-
You may also want to use [decorators](./../decorators.md) to add any filtering or transformation needed for your API descriptions, either before or after combining.
32+
If you need to apply any filtering or transformation using [decorators](./../decorators.md), use the [`bundle`](./bundle.md) command on your API descriptions before or after joining them.
2333

2434
## Usage
2535

@@ -66,7 +76,9 @@ redocly join first-api.yaml second-api.json
6676

6777
The output file `openapi.yaml` is created in the working directory:
6878

69-
The order of input files affects how their content is processed. The first provided file is always treated as the "main" file, and its content has precedence over other input files when combining them. Specifically, the following properties of the API description are always taken only from the first input file:
79+
The order of input files affects how their content is processed.
80+
The first provided file is always treated as the "main" file, and its content has precedence over other input files when combining them.
81+
Specifically, the following properties of the API description are always taken only from the first input file:
7082

7183
<pre>
7284
info:
@@ -100,11 +112,13 @@ If some operations in an input file don't have a tag assigned to them, the `join
100112

101113
If any of the input files contain the `x-tagGroups` object, the content of this object is ignored by the `join` command and not included in the output file.
102114

103-
The `info.title` field is used as a name in `x-tagGroups` instead of a file name for the `join` command, so you can join files with the same names. If you need to adjust the `info.title` field, you can also use the [info-override decorator](https://redocly.com/docs/cli/decorators/info-override/).
115+
The `info.title` field is used as a name in `x-tagGroups` instead of a file name for the `join` command, so you can join files with the same names.
116+
If you need to adjust the `info.title` field, apply the [info-override decorator](https://redocly.com/docs/cli/decorators/info-override/) using the [`bundle`](./bundle.md) command before joining the files.
104117

105118
{% /admonition %}
106119

107-
The `servers` object combines the content from all input files, starting with the content from the first file. Commented lines are not included in the output file.
120+
The `servers` object combines the content from all input files, starting with the content from the first file.
121+
Commented lines are not included in the output file.
108122

109123
Path names and component names must be unique in all input files, but their content doesn't have to be unique for the `join` command to produce the output file. For each path item object, only the operation ID must be unique.
110124

@@ -184,7 +198,8 @@ This command sets the `--without-x-tag-groups` option:
184198
redocly join first-api.yaml second-api.json --without-x-tag-groups
185199
```
186200

187-
The tag description is taken from the first file that contains the tag. You may see a warning about conflicts in the command output:
201+
The tag description is taken from the first file that contains the tag.
202+
You may see a warning about conflicts in the command output:
188203

189204
<pre>
190205
warning: 1 conflict(s) on tags description.
@@ -194,7 +209,8 @@ openapi.yaml: join processed in 69ms
194209

195210
### Resolve conflicting component names
196211

197-
If any of the input files have conflicting component names, this option can be used to resolve that issue and generate the output file. All component names in the output file are prefixed by the selected property from the `info` object of the corresponding input file(s).
212+
If any of the input files have conflicting component names, this option can be used to resolve that issue and generate the output file.
213+
All component names in the output file are prefixed by the selected property from the `info` object of the corresponding input file(s).
198214

199215
This command uses the `version` property as the prefix:
200216

@@ -256,7 +272,8 @@ components:
256272

257273
### Specify output file
258274

259-
By default, the CLI tool writes the joined file as `openapi.yaml` or `openapi.json` in the current working directory. Use the optional `--output` argument to provide an alternative output file path.
275+
By default, the CLI tool writes the joined file as `openapi.yaml` or `openapi.json` in the current working directory.
276+
Use the optional `--output` argument to provide an alternative output file path.
260277

261278
```bash Command
262279
redocly join --output=openapi-custom.yaml

docs/@v2/commands/preview.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
## Introduction
44

5-
The `preview` command starts a local preview server for a Redocly project. Use the preview server to develop your project locally before deployment.
5+
The `preview` command starts a local preview server for a Redocly project.
6+
Use the preview server to develop your project locally before deployment.
67

78
## Usage
89

@@ -37,7 +38,8 @@ redocly preview --product=revel
3738

3839
### Select a plan for preview
3940

40-
By default, previews are run in enterprise plan mode. This mode makes all of the enterprise features available.
41+
By default, previews are run in enterprise plan mode.
42+
This mode makes all of the enterprise features available.
4143
Switch the preview to pro plan mode by setting the `--plan` option to `pro`:
4244

4345
```bash
@@ -46,7 +48,8 @@ redocly preview --plan=pro
4648

4749
### Specify project directory
4850

49-
By default, the preview command uses the current directory. To specify another directory, provide a path relative to the current directory using the `--project-dir` option:
51+
By default, the preview command uses the current directory.
52+
To specify another directory, provide a path relative to the current directory using the `--project-dir` option:
5053

5154
```bash
5255
redocly preview --project-dir=./path/to/my/docs/

docs/@v2/commands/push.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ Have the following values ready to use with the `push` command:
1616
- An active organization [API key](https://redocly.com/docs/realm/setup/how-to/api-keys).
1717
- [Redocly CLI](../installation.md) installed.
1818

19-
Use the `REDOCLY_AUTHORIZATION` environment variable to set the API key. See the [Manage API keys](https://redocly.com/docs/realm/setup/how-to/api-keys) page in the documentation for details on how to get your API key in Reunite.
19+
Use the `REDOCLY_AUTHORIZATION` environment variable to set the API key.
20+
See the [Manage API keys](https://redocly.com/docs/realm/setup/how-to/api-keys) page in the documentation for details on how to get your API key in Reunite.
2021

2122
## Command usage
2223

@@ -115,7 +116,8 @@ npx @redocly/cli push docs/museum.yaml \
115116
--wait-for-deployment
116117
```
117118

118-
The `docs/museum.yaml` file from the repository the action is running on is added to the `/docs/remotes/cicd` folder. The change is made on behalf of the latest commit author and uses the most recent commit message.
119+
The `docs/museum.yaml` file from the repository the action is running on is added to the `/docs/remotes/cicd` folder.
120+
The change is made on behalf of the latest commit author and uses the most recent commit message.
119121

120122
The `--commit-sha`, `--commit-url`, `--namespace`, `--repository` options are used to attach the details of the push to the deployment and are also shown on the Reunite "Deployments" page.
121123
This information is useful in case you have multiple sources for the pushes.

docs/@v2/commands/respect.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,14 @@ slug:
66

77
# `respect`
88

9+
## Introduction
10+
911
Use this command to execute API tests described in an Arazzo description.
1012

13+
{% admonition type="warning" name="Important" %}
14+
The `respect` command supports Arazzo 1.0.1 descriptions only.
15+
{% /admonition %}
16+
1117
## Usage
1218

1319
```sh

0 commit comments

Comments
 (0)