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
611 stars 167 forks source link

Issue with oneOf #102

Open ychyrski opened 7 years ago

ychyrski commented 7 years ago

Given schema provided at http://brutusin.org/json-forms/#7 and Initial data

{ "p1": "test", "p2": true }

Generated form still creates single element with dropdown in order to choose the object type and then after the right one has been choosen shows values from given Initial data.

I think it is possible to validate data agianst subschemas in oneOf and either shorten the dropdown list (if there are multiple matches) or resolve particular schema which matches given data

ychyrski commented 7 years ago

Any thoughts?