import schema from "../../../sequoia.schema.json" with { type: "json" }; type PropertyInfo = { path: string; type: string; required: boolean; default?: string | number | boolean; description?: string; }; function extractProperties( properties: Record, required: string[], parentPath: string, result: PropertyInfo[], ): void { for (const [key, value] of Object.entries(properties)) { const prop = value as Record; const fullPath = parentPath ? `${parentPath}.${key}` : key; const isRequired = required.includes(key); if (prop.properties) { extractProperties( prop.properties as Record, (prop.required as string[]) || [], fullPath, result, ); } else { result.push({ path: fullPath, type: prop.type, required: isRequired, default: prop.default, description: prop.description, } as PropertyInfo); } } } export default function ConfigTable() { const rows: PropertyInfo[] = []; extractProperties( schema.properties as Record, schema.required as string[], "", rows, ); return ( {rows.map((row) => ( ))}
Field Type Required Default Description
{row.path} {row.type} {row.required ? "Yes" : ""} {row.default === undefined ? ( "-" ) : ( {typeof row.default === "string" ? `"${row.default}"` : `${row.default}`} )} {row.description || "—"}
); }