react-jsonschema-form: oneOf doesn't work with objects
Prerequisites
- I have searched the existing issues
- I understand that providing a SSCCE example is tremendously useful to the maintainers.
- I have read the documentation
- Ideally, I’m providing a sample JSFiddle, Codesandbox.io or preferably a shared playground link demonstrating the issue.
What theme are you using?
core
Version
5.x
Current Behavior
The form shows wrong error messages in case the schema contains oneOf with objects inside and the user changes between the available options.
The unexpected errors:
- must NOT have additional properties
- must match exactly one schema in oneOf
Expected Behavior
The form should work fine with all kinds of oneOf schemas.
Steps To Reproduce
- Go to Playground
- Enable Live Validation
- Select ‘Option 2’
- Select ‘Option 1’
Environment
RJSF playground
Anything else?
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 20 (9 by maintainers)
The discriminator provides a performance increase with the oneOf computations
Hi, @heath-freenome - maybe I didn’t notice something, but your link seems to be the same as the first one. The problem is when both branches are objects, like in the link I gave. I paste it again: link It behaves a bit strange: if you play with clicking on reset, validate and changing the option - then sometimes it says ok, sometimes gives errors. To me it seems either a cache like issue, or like the validator wouldn’t fall back from the wrong branch.