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

Error on the demo "oneOf" #98

Closed geoshar closed 7 years ago

geoshar commented 7 years ago

hello, when you select the "oneOf" on the demo, and select "an Object" then put some data on the inputs, then press "getData()" button, and you get error like

brutusin-json-forms.js:837 Uncaught TypeError: Cannot read property '$ref' of null
    at removeEmptiesAndNulls (brutusin-json-forms.js:837)
    at removeEmptiesAndNulls (brutusin-json-forms.js:876)
    at Object.obj.getData (brutusin-json-forms.js:894)
    at HTMLButtonElement.onclick (VM42 :267)

that is.

geoshar commented 7 years ago

i guess instead of

  if (ss === null) {
                    ss = SCHEMA_ANY;
                }

should be

  if (s === null) {
                    s = SCHEMA_ANY;
                }

this fixes the error

idelvall commented 7 years ago

thanks!