You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The toJsonSchema feature of a schema is very welcome. I'm using it to extract default values from the schema, so you don't have to specify that manually when doing form validation. Right now though, Arktype throws an exception when it encounters a type it cannot convert to JSON Schema, like Date.
What I would like is an option to handle that myself, for example to return a custom JSON Schema for those types.
Of course, it's vital that default values are also included. :)
💡 Solution
I've looked at numerous "to-json-schema" solutions for Superforms, and one of the best parsers I've seen is valibot-json-schema. I've linked to its options for custom conversions. It has well-defined types which makes it easy to handle compared to Arktype, but maybe it will give some inspiration at least.
The text was updated successfully, but these errors were encountered:
Request a feature
🤷 Motivation
The
toJsonSchema
feature of a schema is very welcome. I'm using it to extract default values from the schema, so you don't have to specify that manually when doing form validation. Right now though, Arktype throws an exception when it encounters a type it cannot convert to JSON Schema, likeDate
.What I would like is an option to handle that myself, for example to return a custom JSON Schema for those types.
Of course, it's vital that default values are also included. :)
💡 Solution
I've looked at numerous "to-json-schema" solutions for Superforms, and one of the best parsers I've seen is valibot-json-schema. I've linked to its options for custom conversions. It has well-defined types which makes it easy to handle compared to Arktype, but maybe it will give some inspiration at least.
The text was updated successfully, but these errors were encountered: