Skip to content

Commit 2450623

Browse files
authored
fix(cli): example gen for non-object types (#4647)
1 parent f887c52 commit 2450623

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/fdr-sdk/src/converters/db/examples/generateHttpBodyExample.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,9 @@ function getAllObjectProperties(
383383
type = resolveAlias(type.shape.value.value, resolveTypeById);
384384
}
385385
if (type.shape.type !== "object") {
386-
throw new Error("Object extends non-object " + typeId);
386+
// Skip non-object types in extends (e.g., primitives or aliases to primitives)
387+
// This can occur when converting from OpenAPI where allOf might include non-objects
388+
return [];
387389
}
388390
return getAllObjectProperties(type.shape, resolveTypeById);
389391
})

0 commit comments

Comments
 (0)