mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
- 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>
15 lines
413 B
TypeScript
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
|
|
}
|