-
Notifications
You must be signed in to change notification settings - Fork 52
uiSchema Error: schema is invalid: data.properties['liquidity'].properties should be object, when model is in an array #109
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Any chance to create reproduction repo to understand better? |
https://codesandbox.io/s/example-1-forked-gdh4w it is rendering in the sandbox (with error), but in a webpage, it will just crash (not rendering all of uiSchema) |
Hi @HugoKeung Thanks for the reproduction. I've looked at the sandbox and confirmed the issue and written a patch. I'll release the fix in the next version, |
A fix has been released in See a demo here: Demo |
This is to ensure the path for "array" type is constructed properly, as Ajv doesn't want us to include the index. See #109 for more information about the problem.
Hi @jarvelov , the Demo only display one venue and venue type but empty field value. Is that expected? I have a requirement to create a read only form to display schema containing array eg {
"success": true,
"result": {
"contactname": "Karina S",
"contactemail": "karina.s@tsoft.com",
"additiondetail": "Test Only",
"requesttype": "New Sim",
"simrequestdetail": [
{
"simserial": "1111111",
"selectedplan": "Voice (High Data)",
"allocation": "Division - C / Group -BC / IT",
"username": "Kari"
},
{
"simserial": "222222",
"selectedplan": "Voice (Low Data)",
"allocation": "Division - C / Group -BC / HR",
"username": "Kari"
}
],
"submissiondate": "Sep 14, 2021, 9:09:31 AM",
"contactnumber": "555 5555",
"type": "S Request",
"deliveryaddress": "Some address",
"status": "Open"
}
}
Was hoping to use your library to make it happen. Thanks. |
I want to create a JSON as following
{ "stock":{ "shops":[ {"location": "high street"}, {"location": "mall"} ] }, "name":"john" }
through normal javascript, I can access the first shop detail with
stock.shops[0]
I can put
name
undermodel
in the uiSchema to correctly link the name (like the following)component: "div", fieldOptions: { class: ["form-group"], }, children: [ { component: "label", fieldOptions: { attrs: { for: "name-id", }, class: ["font-weight-bold"], domProps: { innerHTML: "Name", }, }, }, { component: "input", model: "name", errorOptions: { class: ["is-invalid"], }, fieldOptions: { attrs: { id: "name-id", }, class: ["form-control"], on: ["input"], }, },
however, putting
stock.shops[0]
result in the following errorError: schema is invalid: data.properties['shops'].properties should be object
How should I go about if I want to add an array for
shops
as shown in my example?The text was updated successfully, but these errors were encountered: