Skip to content

feat(docs): add layout.api-reference-layout to docs.yml - #17377

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1786478278-api-reference-layout
Open

feat(docs): add layout.api-reference-layout to docs.yml#17377
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1786478278-api-reference-layout

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a layout.api-reference-layout key to docs.yml so sites can choose how nested object fields render in the API Reference:

layout:
  api-reference-layout: cards # default: indented
  • indented — nested levels render as an indented connector-line tree with a path breadcrumb per level.
  • cards — the legacy bordered-card nesting.

The CLI only validates and forwards the value; the default and the rendering live in fern-platform (https://github.com/fern-api/fern-platform/pull/13441). Follows changelog-layout (fd5604f) exactly: new enum in the docs-yml definition, the raw-schema key, and passthrough in convertLayoutConfig, which stays inside the existing as unknown as cast until the published FDR SDK carries apiReferenceLayout.

 // parseDocsConfiguration.ts convertLayoutConfig
+  apiReferenceLayout: layout.apiReferenceLayout,
   } as unknown as docsYml.ParsedDocsConfiguration["layout"];

Changes Made

  • fern/apis/docs-yml/definition/docs.yml: ApiReferenceLayout enum + optional api-reference-layout on LayoutConfig.
  • DocsYmlSchemas.ts: zod ApiReferenceLayout, "api-reference-layout" on the raw LayoutConfig.
  • parseDocsConfiguration.ts: passthrough with no default (omitted means platform default).
  • Regenerated artifacts — not hand-edited: docs-yml SDK via fern generate --local --api docs-yml, JSON schemas via pnpm docs-yml:jsonschema and pnpm fern-yml:jsonschema. The generated ApiReferenceLayout.ts files came out byte-identical in shape to ChangelogLayout.ts.
  • CLI changelog entry (feat) under changes/unreleased/.

Testing

  • pnpm compile — 160/160 tasks pass.
  • pnpm turbo run test --filter @fern-api/configuration --filter @fern-api/configuration-loader --filter @fern-api/workspace-loader — 33/33 tasks, all tests pass.
  • pnpm lint:biome, pnpm format — clean, no fixes applied.
  • Verified api-reference-layout landed in all three generated JSON schemas (docs-yml.schema.json, packages/cli/workspace/loader/src/docs-yml.schema.json, fern-yml.schema.json).
  • Unit tests added — none; mirrors changelog-layout, which has no dedicated test (the key is covered by schema validation).

Docs: fern-api/docs#6596

Link to Devin session: https://app.devin.ai/sessions/1f176e5bc4fc49f480e0be1183283042


Open in Devin Review

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@nitpickybot nitpickybot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Review Summary

Purely additive plumbing for a new layout.api-reference-layout enum, mirroring the existing changelog-layout pattern: docs-yml definition, zod raw schema, generated SDK/serializers, JSON schemas, and a passthrough in convertLayoutConfig. Generated artifacts look consistent with the definition (both docs-yml.schema.json copies are in sync). No functional bugs spotted; only a note about the widening as unknown as escape hatch.

  • 🔵 1 suggestion(s)

Comment on lines +679 to +683
// Passed through as-is (no default): omitted renders the indented
// connector-line tree, "cards" renders the legacy nested cards. Resolved
// by the fern-platform companion PR. Part of the `as unknown as` cast
// below until the published FDR SDK adds `apiReferenceLayout`.
apiReferenceLayout: layout.apiReferenceLayout,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 suggestion

This is now the third field smuggled through the as unknown as ParsedDocsConfiguration["layout"] cast, which means a typo in apiReferenceLayout (or a mismatch with the eventual FDR field name) compiles silently and fails only at runtime in the platform. Consider a narrow local type (e.g. type PendingLayoutFields = { changelogLayout?: ...; apiReferenceLayout?: ...; showNavAvailabilityBadges?: boolean }) spread into the cast so at least the pending keys are typed, and confirm the downstream docs-registration path forwards unknown layout keys rather than mapping fields explicitly.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@github-actions

Copy link
Copy Markdown
Contributor

Docs Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-11T04:28:29Z).

Fixture main PR Delta
docs 260.1s (n=5) 290.9s (35 versions) +30.8s (+11.8%)

Docs generation runs fern generate --docs --preview end-to-end against the benchmark fixture with 35 API versions (each version: markdown processing + OpenAPI-to-IR + FDR upload).
Delta is computed against the nightly baseline on main.
Baseline from nightly run(s) on main (latest: 2026-08-11T04:28:29Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-11 20:26 UTC

@github-actions

Copy link
Copy Markdown
Contributor

SDK Generation Benchmark Results

Comparing PR branch against median of 5 nightly run(s) on main (latest: 2026-08-11T04:28:29Z).

Full benchmark table (click to expand)
Generator Spec main (generator) main (E2E) PR (generator) Delta
csharp-sdk square 90s (n=5) N/A 71s -19s (-21.1%)
go-sdk square 145s (n=5) 303s (n=5) 125s -20s (-13.8%)
java-sdk square 233s (n=5) 285s (n=5) 236s +3s (+1.3%)
php-sdk square 80s (n=5) N/A 62s -18s (-22.5%)
python-sdk square 152s (n=5) 256s (n=5) 133s -19s (-12.5%)
ruby-sdk-v2 square 110s (n=5) 140s (n=5) 73s -37s (-33.6%)
rust-sdk square 228s (n=5) 236s (n=5) 193s -35s (-15.4%)
swift-sdk square 79s (n=5) 453s (n=5) 59s -20s (-25.3%)
ts-sdk square 176s (n=5) 181s (n=5) 101s -75s (-42.6%)

main (generator): generator-only time via --skip-scripts (includes Docker image build, container startup, IR parsing, and code generation — this is the same Docker-based flow customers use via fern generate). main (E2E): full customer-observable time including build/test scripts (nightly baseline, informational). Delta is computed against generator-only baseline.
⚠️ = generation exited with a non-zero exit code (timing may not reflect a successful run).
Baseline from nightly runs on main (latest: 2026-08-11T04:28:29Z). Trigger benchmark-baseline to refresh.
Last updated: 2026-08-11 20:27 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant