brutusin/json-forms

readOnly and default is not available at item of array

Closed this issue · 9 comments

readOnly and default is not available at item of array

can you provide an example?

it did well in http://brutusin.org/json-forms/,but failed in master code 。here is my test data
{
"type": "array",
"items":{
"type":"object",
"properties":{
"a":{
"type":"string",
"readOnly":true,
"default":"asdf"
}
}
}
}

you need to specify initial data

I see your point, using "default"... I will work on it

As far as i can see, it's working properly.
Maybe you are inputting invalid initial data?

I debug to this line, initialValue is an empty object. but in http://brutusin.org/json-forms/ initialValue is null.
if (typeof initialValue !== "undefined" && initialValue !== null) {
value = getInitialValue(id);
} else {
value = s.default;
}

oh ,I knew the reason ,because I pass an initial data
bf.render(container, {});

I'm sorry to trouble you , thank you so much!

no trouble at all!