Files
metabuilder/codegen/src/schemas/schema-loader.ts
johndoe6345789 a51130a127 feat: Add external low-code and postgres repositories
- codegen: Low-code React app with JSON-driven component system
- packagerepo: Schema-driven package repository with backend/frontend
- postgres: Next.js app with Drizzle ORM and PostgreSQL

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 16:48:52 +00:00

15 lines
413 B
TypeScript

import { PageSchema } from '@/types/json-ui'
export function hydrateSchema(jsonSchema: any): PageSchema {
// Validate basic schema structure
if (!jsonSchema || typeof jsonSchema !== 'object') {
throw new Error('Invalid schema: expected an object')
}
if (!jsonSchema.id || !jsonSchema.name) {
console.warn('Schema missing required fields: id and name')
}
return jsonSchema as PageSchema
}