Skip to content

Commit 6af1bac

Browse files
louis-preclaude
andcommitted
Skip links to undocumented resources in generated API docs
Check isUndocumented before generating resource links in endpoint responses. Prevents broken links to pages that don't exist because the resource namespace is undocumented (e.g., unstable_partner). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 9b45fb0 commit 6af1bac

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

codegen/lib/layout/api-endpoint.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export function setEndpointLayoutContext(
173173
)
174174

175175
let responsePath = null
176-
if (responseResource != null) {
176+
if (responseResource != null && !responseResource.isUndocumented) {
177177
responsePath = path
178178
.relative(endpoint.path, responseResource.routePath)
179179
.replace('..', '.') // gitbook expects first level to be .
@@ -196,7 +196,7 @@ export function setEndpointLayoutContext(
196196
(r) => r.resourceType === batchResource.resourceType,
197197
)
198198
let batchResponsePath = null
199-
if (batchResourceDef != null) {
199+
if (batchResourceDef != null && !batchResourceDef.isUndocumented) {
200200
batchResponsePath = path
201201
.relative(endpoint.path, batchResourceDef.routePath)
202202
.replace('..', '.')

0 commit comments

Comments
 (0)