I’m looking to avoid specifying a UI schema as we have clients who are writing schemas for us and writing a UI schema is not something we want them to have to do.
However im looking to be able to create some horizontal and vertical nested areas for some fields by using a nested object
like so:
groupArea: {
type: "object",
properties: {
name: {
type: "string",
},
anotherField: {
type: "string"
}
},
}
this exists in side an existing:
$schema: "http://json-schema.org/draft-07/schema#",
type: "object",
properties: {
otherRootField: {
type: "string",
},
rootLevelField: {
type: "string"
},
groupArea: {
...
}
}
I’ve added a layout renderer like so:
...vanillaRenderers,
{
tester: rankWith(3, schemaTypeIs("string")),
renderer: TextControl,
},
{
tester: rankWith(
4,
schemaMatches((schema) => schema.hasOwnProperty("enum"))
),
renderer: RadioControl,
},
{
tester: rankWith(5, schemaTypeIs("object")),
renderer: withJsonFormsLayoutProps((props) => {
return (
<div style={{ backgroundColor: "red", width: '300px', height: '300px' }}>
<VerticalLayout {...props} />
</div>
);
}),
},
but I find that the UI schema generator just creates an empty object for the nested object instead of a VerticalLayout with the items underneath.
Please let me know if theres a way to do this