xsschema
extra-small, Standard Schema-based alternative to typeschema.
Coverage
validate
doesn't require manual support and works with any Standard Schema-compatible library.
Here is the list of libraries that toJsonSchema
is compatible with:
Implementer | Version(s) | Status |
---|---|---|
Zod | 3.24.0+ | Supported |
Valibot | v1.0+ | Supported |
ArkType | v2.0+ | Supported |
Effect Schema | v3.13.0+ | Supported |
Usage
If you're using xsAI, this package is a dependency of some of those packages - you don't need to install it separately.
toJsonSchema
toJsonSchemaSync (experimental)
toJsonSchema
is async (because it has to await import
the vendor's dependencies), but we also support a synchronous version: toJsonSchemaSync
.
Before using toJsonSchemaSync
, you must call initToJsonSchemaSyncVendor
with your schema vendor.
You can register multiple schema vendors if you need to.
validate
Edit on GitHub
Last updated on