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/api-standards.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,22 @@ seo:
5
5
6
6
# API standards and governance
7
7
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.
9
10
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.
11
14
12
15
## Ensure compliance with API linting
13
16
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.
15
20
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.
17
24
18
25
Once the ruleset is created, use it with your API and Redocly in any or all of these ways:
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
+
8
13
## Usage
9
14
10
15
```bash
@@ -63,12 +68,14 @@ You can generate a build by including the API name with the command, as shown in
63
68
redocly build-docs games@v1
64
69
```
65
70
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.
67
73
Any additional configurations provided in the file are also used by the command.
68
74
69
75
### Use an alternative configuration file
70
76
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.
Copy file name to clipboardExpand all lines: docs/@v2/commands/bundle.md
+8-3Lines changed: 8 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,16 @@
2
2
3
3
## Introduction
4
4
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.
6
8
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.
8
11
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.
10
15
11
16
The `bundle` command first executes preprocessors, then rules, then decorators.
Copy file name to clipboardExpand all lines: docs/@v2/commands/completion.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,8 @@
2
2
3
3
## Introduction
4
4
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.
Copy file name to clipboardExpand all lines: docs/@v2/commands/join.md
+29-12Lines changed: 29 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,23 +3,33 @@
3
3
## Introduction
4
4
5
5
{% 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.
7
8
8
9
The `join` command supports OpenAPI 3.x descriptions only.
9
10
{% /admonition %}
10
11
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.
12
15
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.
14
20
15
21
To easily distinguish the origin of OpenAPI objects and properties, you can optionally instruct the `join` command to prepend custom prefixes to them.
16
22
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.
18
27
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.
20
30
21
31
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 descriptionsbefore or after joining them.
The output file `openapi.yaml` is created in the working directory:
68
78
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:
70
82
71
83
<pre>
72
84
info:
@@ -100,11 +112,13 @@ If some operations in an input file don't have a tag assigned to them, the `join
100
112
101
113
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.
102
114
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.
104
117
105
118
{% /admonition %}
106
119
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.
108
122
109
123
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.
110
124
@@ -184,7 +198,8 @@ This command sets the `--without-x-tag-groups` option:
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:
188
203
189
204
<pre>
190
205
warning: 1 conflict(s) on tags description.
@@ -194,7 +209,8 @@ openapi.yaml: join processed in 69ms
194
209
195
210
### Resolve conflicting component names
196
211
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).
198
214
199
215
This command uses the `version` property as the prefix:
200
216
@@ -256,7 +272,8 @@ components:
256
272
257
273
### Specify output file
258
274
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.
Copy file name to clipboardExpand all lines: docs/@v2/commands/preview.md
+6-3Lines changed: 6 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,8 @@
2
2
3
3
## Introduction
4
4
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.
6
7
7
8
## Usage
8
9
@@ -37,7 +38,8 @@ redocly preview --product=revel
37
38
38
39
### Select a plan for preview
39
40
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.
41
43
Switch the preview to pro plan mode by setting the `--plan` option to `pro`:
42
44
43
45
```bash
@@ -46,7 +48,8 @@ redocly preview --plan=pro
46
48
47
49
### Specify project directory
48
50
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:
Copy file name to clipboardExpand all lines: docs/@v2/commands/push.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,8 @@ Have the following values ready to use with the `push` command:
16
16
- An active organization [API key](https://redocly.com/docs/realm/setup/how-to/api-keys).
17
17
-[Redocly CLI](../installation.md) installed.
18
18
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.
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.
119
121
120
122
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.
121
123
This information is useful in case you have multiple sources for the pushes.
0 commit comments