export function getSchema(model: string): any {
const schemaPath = path.join(dirname(fileURLToPath(import.meta.url)), '../../sdk/wasp/ext-src/server/utils/schemas', `${model}.schema.json`);
try {
return JSON.parse(fs.readFileSync(schemaPath, 'utf8'));
} catch (error) {
throw new Error(`Error reading or parsing schema file: ${error}`);
}
}
export function getSchema(model: string): any {
const schemaPath = path.join(dirname(fileURLToPath(import.meta.url)), '../../sdk/wasp/ext-src/server/utils/schemas', `${model}.schema.json`);
try {
return JSON.parse(fs.readFileSync(schemaPath, 'utf8'));
} catch (error) {
throw new Error(`Error reading or parsing schema file: ${error}`);
}
}