guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Regression loading array data with v 2.7.0

kottle opened this issue · comments

After version: 2.5.9 has been introduced a bug so the library cannot load data from array, the scenario is very simple and reproducible running ngx-schema-form-demo with:
sampleschema.json:

{
    "$schema": "http://json-schema.org/draft-04/hyper-schema#",
    "type": "object",
    "properties": {
        "contributors": {
            "description": "Contributors",
            "type": "array",
            "items": {
                "type": "string",
                "widget": {
                    "id": "string"
                }
            }
        }
    }
}

samplemodel.json:

{
    "contributors": [
        "first",
        "second"
    ]
}

The result is an empty array
Schermata del 2022-01-12 23-08-16

As suggested in #318 by aderman I locally fixed uncommenting reset in form.component

` if (this.model) {
        // this.rootProperty.reset(this.model, false);
} 

`