Skip to content

Commit 3c0e090

Browse files
Trim redirects section to cross-reference; add validation rules table to fern check docs
1 parent bfe4489 commit 3c0e090

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

fern/products/cli-api-reference/pages/commands.mdx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,20 @@ hideOnThisPage: true
328328
fern check --warnings
329329
```
330330

331+
### Validation rules
332+
333+
`fern check` runs the following validation rules. Each rule can be set to `"warn"` or `"error"` via [`check.rules`](/learn/docs/configuration/site-level-settings#check-configuration) in `docs.yml`.
334+
335+
| Rule | Default | Description |
336+
|------|---------|-------------|
337+
| `broken-links` | `error` | Detects broken internal links and malformed URLs. |
338+
| `example-validation` | `warn` | Validates OpenAPI examples against their schemas. |
339+
| `no-non-component-refs` | `error` | Flags `$ref` values pointing outside `#/components` in an OpenAPI spec. |
340+
| `valid-local-references` | `warn` | Checks that local `$ref` values resolve to existing definitions. |
341+
| `no-circular-redirects` | `error` | Detects redirect chains that loop back to a previously visited path. |
342+
| `valid-docs-endpoints` | `warn` | Checks that endpoint URLs in `docs.yml` are well-formed. |
343+
| `missing-redirects` | `warn` | Flags pages removed or moved without a [redirect](/learn/docs/seo/redirects). Compares against the previously published state. Requires authentication; skipped on first publish. |
344+
331345
## Usage in a GitHub Action
332346

333347
<CodeBlock title = ".github/workflows/fern-check.yml" >

fern/products/docs/pages/seo/redirects.mdx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,7 @@ subtitle: Learn how to configure redirects in Fern Docs. Set up exact path redir
1414

1515
## Catching missing redirects
1616

17-
The `missing-redirects` rule for [`fern check`](/learn/cli-api-reference/commands#check) automatically detects pages that were removed or moved without a redirect. It compares your current docs navigation against the previously published state and warns when a previously published URL would return a 404.
18-
19-
The rule defaults to `warn` severity. To treat missing redirects as errors, configure the rule in `docs.yml`:
20-
21-
```yaml docs.yml
22-
check:
23-
rules:
24-
missing-redirects: error
25-
```
26-
27-
The check requires authentication via `fern login` or the `FERN_TOKEN` environment variable. It is skipped on first publish, when unauthenticated, or when the network is unavailable.
28-
29-
For the full list of `fern check` validation rules, see [Check configuration](/learn/docs/configuration/site-level-settings#check-configuration).
17+
You can use [`fern check`](/learn/cli-api-reference/commands#check) to automatically detect pages that were removed or moved without a redirect. Configure the [`missing-redirects` rule](/learn/docs/configuration/site-level-settings#check-configuration) in `docs.yml` to control its severity.
3018

3119
<llms-only>
3220
## Common errors

0 commit comments

Comments
 (0)