'use client'; import type { ApiEndpoint } from '../../../../types'; import { SchemaFields } from '../SchemaFields'; interface RequestBodyProps { body: NonNullable; } /** Request body preview. Shows a short type summary line (``object``, * ``array``, …) alongside the body description, then the * tree-view of fields. The example payload is rendered below in its * own section (code samples) because the user often wants to copy it * independently from inspecting the shape. */ export function RequestBody({ body }: RequestBodyProps) { const typeLabel = body.schema ? body.type === 'array' ? `array<${(body.schema as { items?: { type?: string } }).items?.type ?? 'object'}>` : body.type : body.type; return (
{typeLabel} {body.description && ( {body.description} )}
{body.schema && }
); }