I’m investigating JSONForms 3.x for use on a pretty large project, and one of the things we’d like to use it for is layout reuse. I understand refs need to be resolved ourselves etc, that’s all fine.
One thing that would be useful is having the ability in the Groups to define a top level scope, and then in the elements have their scope relative to the group.
So let’s say I have a Billing Address and a Shipping Address that both refer to the same $def. In our code we would take the common Address UI Schema and build a complete UI schema for the layout. Unless I missed something, I believe all elements in the groups need need to be full paths, ie:
"scope": "#/properties/shipping_address/properties/street_address"
"scope": "#/properties/billing_address/properties/street_address"
etc
It would be awesome if we could define a scope for a group/layout that would join with the scope of the elements so that the inner content of the group/layout would not need to be manipulated. ie:
{
"type": "Group",
"label": "Billing Address",
"scope": "#/properties/billing_address",
"elements": [
{
"type": "Control",
"scope": "properties/street_address",
"label": "Street Address"
},
{
"type": "HorizontalLayout",
"elements": [
{
"type": "Control",
"scope": "properties/city",
"label": "City"
},
{
"type": "Control",
"scope": "properties/state",
"label": "State"
}
]
}
]
},
{
"type": "Group",
"label": "Street Address",
"scope": "#/properties/shipping_address",
"elements": [
<this would be exactly the same as above>
]
},
I did not see anything like this in the documentation, I tried out a few variations of this and didn’t have any success. If there’s a way to do this, or get it added to the roadmap that would be awesome.
Thanks!