Hello!
I am using the 3.0 version of JsonForms and I am using it on Angular.
My problem is that I have a schema with nested objects and on some cases I have cyclic dependencies of objects, something like this:
{
"definitions": {
"LocationInput": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"latitude": {
"type": "string"
},
"longitude": {
"type": "string"
},
"factory": {
"$ref": "#/definitions/LocationInput"
}
}
},
"FactoryInput": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"type": "string"
},
"location": {
"$ref": "#/definitions/LocationInput"
},
}
"type": "object",
"properties": {
"enterprise": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"location": {
"$ref": "#/definitions/LocationInput"
},
"factories": {
"type": "array",
"items": {
"$ref": "#/definitions/FactoryInput"
}
}
}
}
}
I can “escape” cyclic dependency and nested objects in JsonSchema simply by defining the object in definitions and referencing to it as seen above.
My question is, can I do the same thing in UI Schema? Can I create a field “definitons” for the objects and then reference the objects in UI Schema, if they are a property of other objects?
If not, is there a way doing it? I am a bit new to using JsonForms and I don’t know if there is a way doing it and I couldn’t find any example with nested objects or objects with cyclic dependency.
I tried just giving the object’s path on the schema but the thing is in some cases, I have to use custom renderers for the properties of an object, so default renderered UI schema doesn’t work for me.
It would be really great if we can find a solution for this problem.
Thank you in advance!