Skip to content

docs: update #1739

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2024
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
6 changes: 3 additions & 3 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ In previous versions globbing was supported, but that has been **deprecated** in

:::

## Redoc config
## Redocly config

A `redocly.yaml` file isn’t required to use openapi-typescript. By default it extends the `"minimal"` built-in config. But it is recommended if you want to have custom validation rules (or build types for [multiple schemas](#multiple-schemas)). The CLI will try to automatically find a `redocly.yaml` in the root of your project, but you can also provide its location with the `--redoc` flag:

```bash
npx openapi-typescript --redoc ./path/to/redocly.yaml
npx openapi-typescript --redocly ./path/to/redocly.yaml
```

You can read more about the Redoc’s configuration options [in their docs](https://redocly.com/docs/cli/configuration/).
Expand Down Expand Up @@ -104,7 +104,7 @@ The following flags are supported in the CLI:
| `--help` | | | Display inline help message and exit |
| `--version` | | | Display this library’s version and exit |
| `--output [location]` | `-o` | (stdout) | Where should the output file be saved? |
| `--redoc [location]` | | | Path to a `redocly.yaml` file (see [Multiple schemas](#multiple-schemas)) |
| `--redocly [location]` | | | Path to a `redocly.yaml` file (see [Multiple schemas](#multiple-schemas)) |
| `--additional-properties` | | `false` | Allow arbitrary properties for all schema objects without `additionalProperties: false` |
| `--alphabetize` | | `false` | Sort types alphabetically |
| `--array-length` | | `false` | Generate tuples using array `minItems` / `maxItems` |
Expand Down
4 changes: 2 additions & 2 deletions docs/zh/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ npx openapi-typescript
使用 openapi-typescript 不需要 `redocly.yaml` 文件。默认情况下,它扩展了内置配置中的 `"minimal"`。但如果您想要自定义验证规则(或构建[多个模式](#multiple-schemas)的类型),建议使用它。CLI 将尝试在项目根目录自动找到 `redocly.yaml`,但您也可以使用 `--redoc` 标志提供其位置:

```bash
npx openapi-typescript --redoc ./path/to/redocly.yaml
npx openapi-typescript --redocly ./path/to/redocly.yaml
```

您可以在 [Redoc 文档](https://redocly.com/docs/cli/configuration/) 中详细了解 Redoc 的配置选项。
Expand Down Expand Up @@ -104,7 +104,7 @@ CLI 支持以下参数:
| `--help` | | | 显示内联帮助消息并退出 |
| `--version` | | | 显示此库的版本并退出 |
| `--output [location]` | `-o` | (stdout) | 应将输出文件保存在何处? |
| `--redoc [location]` | | | `redocly.yaml` 文件的路径(参见 [多个模式](#multiple-schemas)) |
| `--redocly [location]` | | | `redocly.yaml` 文件的路径(参见 [多个模式](#multiple-schemas)) |
| `--additional-properties` | | `false` | 允许所有模式对象使用 `additionalProperties: false` 之外的任意属性 |
| `--alphabetize` | | `false` | 按字母顺序排序类型 |
| `--array-length` | | `false` | 使用数组 `minItems` / `maxItems` 生成元组 |
Expand Down