import fs from 'fs'; import { zodToJsonSchema } from 'zod-to-json-schema'; import { WebApiSpecSchema } from './WebApiSchema.js'; if (process.argv.length !== 3) { throw new Error('supply path for generated schema as the only argument'); } const jsonSchema = zodToJsonSchema(WebApiSpecSchema, 'WebApiSchema'); fs.writeFileSync(process.argv[2], JSON.stringify(jsonSchema, null, 4)); console.log('WebApiSchema.json generated successfully.');