Hi!
I am trying to create dynamic UISchema with uischema registry entry on Angular, but the JsonFormsUISchemaRegistryEntry array I wrote has a problem with rendering, meaning when I try to run the app I see “No applicable renderer found!”
My schema is like this:
{
"definitions": {
"student": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"age": {
"type": "string"
},
"gender": {
"type": "string"
}
}
},
"building": {
"type": "object",
"properties": {
"age": {"type": "string"},
"color": {"type": "string"}
}
}
},
"type": "object",
"properties": {
"school": {
"type": "object",
"properties": {
"name": {
"type": "string"
},
"students": {
"type": "array",
"items": {
"$ref": "#/definitions/student"
}
},
"building": {
"$ref": "#/definitions/building"
}
}
}
}
}
And my UISchemaRegistry array is like this:
uischemaRegistry: JsonFormsUISchemaRegistryEntry[] = [
{
tester: (schema, schemaPath, path) => {
if (schemaPath === "#/definitions/student")
return 1;
},
uischema: {
type: 'Control',
options: {
scope: "#/definitions/student",
elements: {
name: {
type: 'Control',
options: {
scope: "#/definitions/student/properties/name",
label: 'Name'
}
},
age: {
type: 'Control',
options: {
scope: "#/definitions/student/properties/age",
label: 'Age'
}
},
gender: {
type: 'Control',
options: {
scope: "#/definitions/student/properties/gender",
label: 'Gender'
}
}
}
}
},
},
{
tester: (schema, schemaPath, path) => {
if (schemaPath === "#/definitions/building")
return 1;
},
uischema: {
type: 'Control',
options: {
scope: "#/definitions/building",
elements: {
name: {
type: 'Control',
options: {
scope: "#/definitions/building/properties/age",
label: 'Age'
}
},
age: {
type: 'Control',
options: {
scope: "#/definitions/building/properties/color",
label: 'Color'
}
}
}
}
},
},
{
tester: (schema, schemaPath, path) => {
if (schemaPath === "#/properties/school")
return 1;
},
uischema: {
type: 'Group',
options: {
scope: "#/properties/school",
label: "School",
elements: {
students: {
type: 'ListWithDetail',
options: {
label: "Student",
scope: "#/properties/school/properties/students"
}
},
building: {
type: 'Group',
options: {
scope: "#/definitions/building",
label: 'Building Info'
}
}
}
}
},
}
];
Is there a problem with my uiSchemaRegistry? Sorry if the question is obviously solveable, but I could not find a documentary on how to use uiSchemaRegistry. I hope that someone can help me
Thank you in advance.