Open dbaumgarten opened 2 years ago
We are facing the same issue. As soon as the allOf
-> if/then/else
is inside a "type": "array"
rjsf breaks with the above mentioned error. Seems like resolveCondition
(utils.js) is not executed on those allOf's, so the json-schema-merge-allof
package can't handle it since there are still if
keys inside of the objects of allOf
which usually would be removed with resolveCondition
.
Even thought this allOf then works as expected, other allOf's (at the root for example) won't work anymore.
Additionally we not only have this issue with if
but with enumNames
too. But this most probably is related.
We're facing exactly the same issue and exactly in the same conditions @s1rd4v3 described, i.e. allOf
+ if/then/else
inside an array.
Here's my playground example
Steps to reproduce:
Expected: A new field "numColumns" is shown
Actual: "numColumns" is not shown. There's a warning: could not merge subschemas in allOf: Error: No resolver found for key if. You can provide a resolver for this keyword in the options, or provide a default resolver.
I came back to check this issue and noticed that I couldn't reproduce it anymore with the playground link + steps to reproduce I posted earlier. Maybe this got partially fixed?
It looks to me that even though the playground example doesn't demonstrate the issue anymore, the issue hasn't been fully fixed yet. I'm developing an app where we use version 5.0.0-beta.10
and our schema produces bunch of could not merge subschemas in allOf
warnings. I tried to upgrade to latest version 5.0.0-beta.17
to see if the warnings are still there, and yes, they are still there with the newest version.
I am also still getting this error
Prerequisites
What theme are you using?
core
Version
4.2.0
Current Behavior
I have a schema that makes extensive use of if/then constructs (often inside allOf blocks). Unfortunately it does not work in rjsf and throws the following error in the console:
I have prepared a shortened example of the problematic schema: catalog.txt
Using it in https://rjsf-team.github.io/react-jsonschema-form/ reproduces the issue.
When any of the two allOf blocks is deleted, the schema starts to work just fine.
I think it might be related to #2752 .
Expected Behavior
I would like rjsf to properly render the schema.
Steps To Reproduce
Environment
Anything else?
No response