-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RJSF anyOf customization #4151
Comments
@memchenko I've created an example using your schema with a
|
@heath-freenome Hi, thank you for your response! The example you created contains a couple of problems I try to solve. First problem is that widget for And the second problem is that there appears the dropdown on the top with options "Option 1" and "Option 2" which allows to switch between schemas. However, I'd like it to work the way For illustration I tweaked your example, you can check it here |
@memchenko I think the issue here is that we don't have great support for the If you replace the |
Prerequisites
What theme are you using?
core
What is your question?
Hi everyone!
First, I want to thank you for such awesome library! We use it with collegues a lot and it seems there's no a better alternative.
My question relates to rendering of conditional fields. I know there's support for
dependencies
field and for now we specify conditional fields using this property. And at this moment we're in process of developing a mechanism which would translate Typebox data specification into JSONSchema which would then be rendered by RJSF into form. And the problem is that typebox codegen doesn't generatedependencies
field and seems that there's no other way of describing conditional fields other than with a union of types. This union then is translated asanyOf
in terms of JSONSchema.Here https://rjsf-team.github.io/react-jsonschema-form/docs/api-reference/uiSchema/#anyof I read there's possibility to support such approach with
uiSchema
here. But I'm not sure if it's possible to customize which widget and field would handle my conditional properties. When I tried it didn't worked. Below is an example illustrating my question.Let's say I have a JSONSchema like this:
And when I specify uiSchema like the following:
RJSF doesn't respect what I specify in "ui:widget" fields but renders "select" widget instead. How can I specify custom widget for rendering of such conditional fields? Is it possible at all in case of such json schema definition?
Thanks in advance!
The text was updated successfully, but these errors were encountered: