Closed sabrineChe closed 2 years ago
Hi Can you post your complete schema so I can reproduce it in the playground ?
Thanks
This is the schema:
{
"schema": {
"schemaId": {
"type": "string",
"title": "Schema Record Identifier"
},
"mimeType": {
"type": "string",
"title": "mime Type",
"enum": ["application/json", "application/xml"]
},
"type": {
"type": "string",
"title": "Type",
"enum": ["JSON", "XML"]
},
"label": {
"type": "string",
"title": "Label"
},
"definition": {
"type": "string",
"title": "Definition"
},
"comment": {
"type": "string",
"title": "Comment"
},
"acl": {
"type": "array",
"title": "ACL",
"items": {
"type": "object",
"properties": {
"sid": {
"type": "string",
"title": "sid",
"default": "SELF",
"enum": ["SELF", "admin", "guest"]
},
"permission": {
"type": "string",
"title": "Permission",
"default": "ADMINISTRATE",
"enum": ["READ", "ADMINISTRATE"]
}
}
}
}
}, "form": [
"schemaId",
"mimeType",
"type",
"label",
"definition",
"comment",
{"type": "array",
"title": "ACL",
"htmlClass": "acl",
"items": [
"acl[].sid",
"acl[].permission"
]
}]}
You're looking for :
"items": [
"acl[]"
]
or else you need to define a new object
And if my array includes some attributes, that i don't want to list them in the form. How can i make it?
Let's say my schema includes an array like that:
"acl": { "type": "array", "title": "ACL", "items": { "type": "object", "properties": { "id": { "type": "string", "title": "id" }, "sid": { "type": "string", "title": "sid", "default": "SELF", "enum": ["SELF", "admin", "guest"] }, "permission": { "type": "string", "title": "Permission", "default": "ADMINISTRATE", "enum": ["READ", "ADMINISTRATE"] } } } }
and i want to show only two attributes "sid" and "permission". How can i define my uiForm?
I guess this is not really possible at the moment unfortunately
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, I want to define a uiForm for my schema which includes an array. My schema looks like that:
{ "type": "object", "properties": { "schemaId": { "type": "string", "title": "Schema Record Identifier" }, "acl": { "type": "array", "title": "ACL", "items": { "type": "object", "properties": { "sid": { "type": "string", "title": "sid", "default": "SELF", "enum": ["SELF", "admin", "guest"] }, "permission": { "type": "string", "title": "Permission", "default": "ADMINISTRATE", "enum": ["READ", "ADMINISTRATE"] } } } } } }
And my uiForm looks like that:
{ "type": "fieldset", "title": "Schema Record", "items": [ "schemaId", { "type": "array", "title": "ACL", "htmlClass": "acl", "items": [ "acl[].sid", "acl[].permission" ] } ] }
Unfortunately, only the first element of the array, wich is "sid" appears. The "permission" attribute doesn't appear in the form.