Skip to content

Commit 6d91761

Browse files
github-actions[bot]supabase-releaser[bot]mandarini
authored
docs: update js client libraries (2.78.0) (supabase#40013)
* docs: update js client libraries (2.78.0) * fix(docs): add fallback for unhandled schema types in API reference --------- Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com> Co-authored-by: Katerina Skroumpelou <[email protected]>
1 parent d66307f commit 6d91761

20 files changed

+351114
-83315
lines changed

apps/docs/features/docs/Reference.api.utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,4 +186,9 @@ export function getTypeDisplayFromSchema(schema: ISchema) {
186186
displayName: 'object',
187187
}
188188
}
189+
190+
// Default fallback for unhandled schema types
191+
return {
192+
displayName: 'unknown',
193+
}
189194
}

apps/docs/features/docs/Reference.ui.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,9 +442,11 @@ function ApiOperationRequestBodyDetailsInternal({
442442
) {
443443
return <span className="font-mono text-sm font-medium text-foreground">{schema.type}</span>
444444
} else if (schema.type === 'array') {
445+
const itemTypeDisplay = getTypeDisplayFromSchema(schema.items)
446+
const displayName = itemTypeDisplay?.displayName ?? 'unknown'
445447
return (
446448
<>
447-
<span className="font-mono text-sm font-medium text-foreground">{`Array of ${getTypeDisplayFromSchema(schema.items).displayName}`}</span>
449+
<span className="font-mono text-sm font-medium text-foreground">{`Array of ${displayName}`}</span>
448450
{!(
449451
'type' in schema.items &&
450452
['string', 'boolean', 'number', 'integer'].includes(schema.items.type)

0 commit comments

Comments
 (0)