jsonforms
jsonforms copied to clipboard
Rendering of arrays of union types no longer working from 3.0.0-beta.5
Describe the bug
I am using react with material-renderers. Up to 3.0.0-beta.4 arrays of union types, e.g.
"test": {
"type": "array",
"items": {
"anyOf": [
{
"type": "object",
"properties": {
"value": {
"type": "string"
}
},
"required": ["value"]
},
{
"type": "object",
"properties": {
"value": {
"type": "number"
}
},
"required": ["value"]
}
]
}
}
where rendered, from 3.0.0-beta.5 onward, only the message No applicable renderer found. is displayed.
Expected behavior
An array of union types (anyOf, oneOf) should be rendered again as an array form.
Steps to reproduce the issue
import {
materialRenderers,
materialCells,
} from '@jsonforms/material-renderers';
import { JsonForms } from "@jsonforms/react";
const schema = {
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"test": {
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"value": {
"type": "string"
}
},
"required": ["value"]
},
{
"type": "object",
"properties": {
"value": {
"type": "number"
}
},
"required": ["value"]
}
]
}
},
}
}
const TestComponent = () =>
<div>
<JsonForms
schema={schema}
data={{}}
renderers={materialRenderers}
cells={materialCells}
onChange={(data) => {console.log(data)}}
/>
</div>
export default TestComponent;
Screenshots
beta.4

beta.5

In which browser are you experiencing the issue?
Google Chrome Version 103.0.5060.134 (Official Build) (64-bit)
Framework
React
RendererSet
Material
Additional context
No response
Thanks for the report, we're gonna take a look!