-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
Prerequisites
- I have read the documentationTo pick up a draggable item, press the space bar. While dragging, use the arrow keys to move the item. Press space again to drop the item in its new position, or press escape to cancel.
What theme are you using?
other
Is your feature request related to a problem? Please describe.
I know this task is very likely monumental in size and difficulty, but I only intend this issue to serve as the basis of discussion for this feature, especially as AJV is being updated less and less frequently, which causes concern regarding long-term support.
Standard Schema is a new standard bridging the various JS/TS runtime data validation libraries.
All the most widely used JS/TS libraries (zod, valibot, etc.) conform to it, and it may be the gate toward their integration in RJSF.
Describe the solution you'd like
Up for discussion.
Describe alternatives you've considered
Up for discussion.
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
heath-freenome commentedon May 9, 2025
@TheOneTheOnlyJJ I wonder whether this would help us solve the problem we are facing with #3751. Are you willing to attend one of our Friday meetings as posted in #2417?
TheOneTheOnlyJJ commentedon May 10, 2025
I could join a Friday meeting, but I don't know how much help my presence would be. I am a college undergrad working on my thesis project, reporting bugs and suggesting improvements wherever I see them as potentially fit. I do not have the time or knowledge to make other extra contributions.
Also, take note that I have not used
zod
and Standard Schema in my projects as of now, but I found their syntax and workflow much easier to work with than writing complex JSON schemas.Now, going back to the Standard Schema,
It is not directly related to JSON Schema, so I don't know how much it would help with #3751.
To me, it seems like a similar but still different topic, as it is aimed at supporting the runtime validation libs.
Some of these runtime validation libraries do have a very handy
toJsonSchema()
method for their runtime schema types. For example,zod
will add it in V4: https://v4.zod.dev/v4#json-schema-conversionAnd even better than that, there's an open issue in the Standard Schema repo suggesting the addition of
toJSONSchema()
directly to the standard (standard-schema/standard-schema#21), requiring all of the conforming libraries to support it if approved.If this happens, I see it as nothing less than a direct invitation for RJSF to support all the Standard Schema-compliant runtime validation libraries, conveniently, all at once.
Imagine taking a
zod
,valibot
, or any other such compliant library schema as input, typed as the generic Standard Schema interface, passing it to RJSF, and then just callingtoJSONSchema()
on it, and letting RJSF handle the rest as it already does, no further code changes being required.Take into account that this is a situation in which #3751 may cause issues.
This could even be abstracted as some sort of
inputSchemaAdapter
in RJSF (utils? Maybe just a type declaration would be all that's needed), allowing the formatting of any input type to JSON Schema inside RJSF. This way, developers could add any conversion function they want, and the library can export a set of default functions (such as the Standard Schema adapter).This way, someone could even create an XML Schema (XSD) adapter and have it play nicely with RJSF.