@gcornut/valibot-json-schema

Convert Valibot schemas to JSON Schema format

npmmacoslinuxwindows
Try with needOr install directly
Source

About

> [!CAUTION] > This project is now deprecated as Valibot now has an official JSON schema converter in the [@valibot/to-json-schema](https://github.com/fabian-hiller/valibot/tree/main/packages/to-json-schema). > The command line interface is moved to the p

Commands

valibot-json-schema

Examples

convert valibot schema to JSON schema$ valibot-json-schema input.ts output.json
generate JSON schema from TypeScript validation file$ valibot-json-schema --input src/schemas.ts --output schemas.json
pretty print JSON schema output$ valibot-json-schema schema.ts schema.json --pretty
validate TypeScript schema before conversion$ valibot-json-schema --validate models/user.ts
convert multiple schema files in batch$ valibot-json-schema src/schemas/*.ts dist/schemas/