#json-schema and ui-schema support?

4 messages · Page 1 of 1 (latest)

glass oracle
#

I see from the docs that "@mantine/form supports schema validation with zod, joi and yup out of the box" which is fantastic. Is there any plan to support json-schema and ui-schema? I'd like to use a validation library that I can generate the rules from SQL DDLs and share it across the backend and front end, and json-schema makes that simpler to be backend agnostic.

Today I can trivially generate json-schemas for tables using https://github.com/duartealexf/sql-ddl-to-json-schema and spin up a form in seconds using https://rjsf-team.github.io/react-jsonschema-form/ and then all i need to worry about is styling and rich input support for date ranges and rich text editors which mantine has baked in. I either have to choose these libraries and find a way to marry it with mantine OR have support for generating some validation schema from DDLs with these other libraries so i can use mantine's native form handler. Ouch.

GitHub

SQL DDL to JSON Schema Converter. Contribute to duartealexf/sql-ddl-to-json-schema development by creating an account on GitHub.

#
GitHub

Converts Zod schemas to Json schemas. Contribute to StefanTerdell/zod-to-json-schema development by creating an account on GitHub.

GitHub

Contribute to StefanTerdell/json-schema-to-zod development by creating an account on GitHub.

#

Those just generate zod code to copy paste into the component. Wont generate form inputs or apply zod validation from a json schema. Would still be nice to generate and validate a form from a schema that comes right from the source of trutch (db and fields and their rules). I hate the redundancy of validation in client, then server, then database. The internet was born in 1969 and we're in 2023 with AI and we're still writing all validation rules in triplicate like carbon copy paper form processing, except those were more advanced because you didn't need to have 3 separate rules in 3 separate languages to make it work.

jade pike
# glass oracle I see from the docs that "@mantine/form supports schema validation with zod, joi...

You are welcome to create a library that implement it, publish it to npm and share with the community. You can use a template to get started – https://github.com/mantinedev/mantine-extension-template

GitHub

Template repository for Mantine extensions. Contribute to mantinedev/mantine-extension-template development by creating an account on GitHub.