guillotinaweb / ngx-schema-form

HTML form generation based on JSON Schema
MIT License
485 stars 173 forks source link

VisibleIf - oneOf and allOf #370

Closed daniele-pecora closed 3 years ago

daniele-pecora commented 3 years ago

The processing of the visibleIf.oneOf and visibleIf.allOf fails for all fields if one field set doesn't exist at validation time.

e.G.

     "visibleIf": {
        "oneOf": [
          { 
            // the title doesn't yet exist and will be added at runtime
            // but will now make to fail all the following field checks
            "title": [
              "Dr."
            ]
          },
          {
            "forename": [
              "John"
            ]
          },
          {
            "name": [
              "Doe"
            ]
          }
        ]
      }

Considered solution would be to handle non existing fields as null or undefined values