brutusin / json-forms

JSON Schema to HTML form generator, supporting dynamic subschemas (on the fly resolution). Extensible and customizable library with zero dependencies. Bootstrap add-ons provided
http://brutusin.org/json-forms
Apache License 2.0
607 stars 168 forks source link

unable integrate dynamic schemas with initial data #86

Open MSSoumya opened 7 years ago

MSSoumya commented 7 years ago

I am trying to create a form in which I require the array to have a dynamic schema for a certain field. I tried this by combining http://brutusin.org/json-forms/#3 and http://brutusin.org/json-forms/#0 , the schema, data and resolver for which are here.

Am I doing it wrong ? Is there any alternate way in which I can achieve what I'm trying to do ? If so please help. Thanks.

idelvall commented 7 years ago

Hi @MSSoumya your schema resolver does not produce the schema entries needed. The form is asking the resolver for "$.events-info[#].subspecies", so the schemas object passed to the callback must contain an schema for this entry. I can see this is a sample schema, but have in mind that given your schema definition, this schema is the same for all array entries.

If you post your real needs I could help you better.

Cheers