Prerequisites
What theme are you using?
shadcn
Is your feature request related to a problem? Please describe.
Hello!
I saw in the documentation that "react-jsonschema-form only supports a restricted subset of this -- nullable types, in which an element is either a given type or equal to null".
When a property type is an array of more than one type, the displayed input corresponds to the first type in the array, it is impossible to switch between available types.
It is also an issue when additionalProperties is set to true, the added additional properties type is set to null
and it is impossible to switch to other types.
Describe the solution you'd like
If the property type is an array, like:
const schema: RJSFSchema = {
type: ['string', 'number', 'boolean'],
};
Display a selector allowing to switch between those three types.
If the type isn't precised (for example when additionalProperties is set to true without specifying the schema), display a selector with all available types.
Describe alternatives you've considered
I tried to customize myself the FieldTemplate component and added a selector, but rjsf does not have anything allowing to change the type of a property, it always takes the first one in the array.
Prerequisites
What theme are you using?
shadcn
Is your feature request related to a problem? Please describe.
Hello!
I saw in the documentation that
"react-jsonschema-form only supports a restricted subset of this -- nullable types, in which an element is either a given type or equal to null".When a property type is an array of more than one type, the displayed input corresponds to the first type in the array, it is impossible to switch between available types.
It is also an issue when
additionalPropertiesis set totrue, the added additional properties type is set tonulland it is impossible to switch to other types.
Describe the solution you'd like
If the property type is an array, like:
Display a selector allowing to switch between those three types.
If the type isn't precised (for example when
additionalPropertiesis set totruewithout specifying the schema), display a selector with all available types.Describe alternatives you've considered
I tried to customize myself the
FieldTemplatecomponent and added a selector, but rjsf does not have anything allowing to change the type of a property, it always takes the first one in the array.