Closed
Description
Describe the bug
Since Version 3.0.0-beta.2, the indexOfFittingSchema returns undefined instead, for example 0 or 1.
The Previous Versions worked fine.
If I use the same schema without any refs, it works fine.
oneOf with $ref (official oneOf Example)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"definitions": {
"address": {
"type": "object",
"properties": {
"street_address": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
}
},
"required": [
"street_address",
"city",
"state"
],
"additionalProperties": false
},
"user": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"mail": {
"type": "string"
}
},
"required": [
"name",
"mail"
],
"additionalProperties": false
}
},
"type": "object",
"properties": {
"name": {
"type": "string"
},
"addressOrUser": {
"oneOf": [
{
"$ref": "#/definitions/address"
},
{
"$ref": "#/definitions/user"
}
]
}
},
"required": [
"name"
]
}
oneOf without $ref
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"addressOrUser": {
"oneOf": [
{
"type": "object",
"properties": {
"street_address": {
"type": "string"
},
"city": {
"type": "string"
},
"state": {
"type": "string"
}
},
"required": [
"street_address",
"city",
"state"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"name": {
"type": "string"
},
"mail": {
"type": "string"
}
},
"required": [
"name",
"mail"
],
"additionalProperties": false
}
]
}
},
"required": [
"name"
]
}
Expected behavior
If the bound data matches a oneOf Schema, then it should have an indexOfFittingSchema.
Steps to reproduce the issue
- Go to https://codesandbox.io/s/vigilant-rgb-unncn8?file=/src/schema.json
- Because of the bound data it should render the ONEOF-1 Tab, but it renders the ONEOF-0 Tab (default behavior).
- Change the JsonForms versions to 3.0.0-beta.1
- You will see, that it now works properly
Screenshots
No response
In which browser are you experiencing the issue?
Browser independent
Framework
Core
RendererSet
Material
Additional context
No response