fix(docs): interpret slash docs slugs as parent path
Summary
- Interpret exact
slug: /in docs.yml as an empty child segment so nested pages resolve to the parent path. - Preserve all other explicit docs.yml slugs unchanged.
- Add resolver/unit coverage and a CLI changelog entry for slash-only docs.yml slugs.
Root Cause
Configured slugs from docs.yml were passed directly into SlugGenerator.apply, so a nested page with slug: / could be interpreted as a literal slash segment instead of the parent path. This could produce incorrect preview routing behavior for pages intended to live at the section root.
Validation
pnpm turbo run compile --filter @fern-api/docs-resolvernode_modules\.bin\vitest.cmd --run packages/cli/docs-resolver/src/__test__/absolute-slug-validation.test.ts packages/cli/docs-resolver/src/utils/__test__/getDocsYmlSlug.test.ts --config packages/cli/docs-resolver/vitest.config.tsnode_modules\.bin\tsc.cmd --noEmit -p packages/cli/docs-resolver/tsconfig.jsongit diff --check
Fixes #5634
This PR normalizes configured docs.yml slugs before composing navigation paths, so slug: / is treated as an empty child segment and nested pages resolve to their parent path. The reported case is covered by a resolver regression fixture under the Learn section, plus a small unit test for the slug normalizer.
Validated locally with:
pnpm turbo run compile --filter @fern-api/docs-resolverpnpm exec vitest --run packages/cli/docs-resolver/src/__test__/absolute-slug-validation.test.ts packages/cli/docs-resolver/src/utils/__test__/getDocsYmlSlug.test.ts --config packages/cli/docs-resolver/vitest.config.ts
Small GitHub workflow note: the PR was created from shubhamsinnh:codex/docs-slash-slug, but setting shubhamsinnh as assignee failed because this token/account does not have permission to update assignees on fern-api/fern.
This PR is stale because it has been open 25 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This PR was closed because it has been inactive for 5 days after being marked stale.