Skip to content

WIP/experimental: oneOf and conditional visibility support

This PR, when merged, will enable oneOf pattern for alternative schemas along with their conditional visibility based on a current value of other schemas (it has to be its sibling). This can be accomplished by using a proprietary attrs.visible prop. Example usage:

"attrs": {
  "visible": {
    "deliveryOption": "Electronic subscription"
  }
}

In the example above, the schema will be visible only if a value of a sibling prop named deliveryOption is set to "Electronic subscription" text. If multiple key/value pairs are present in the visible object, they are evaluated with AND operator (all values must match in order for the schema to be visible).

Newsletter example has been updated with a complete example of switching between two oneOf schemas.

Merge request reports

Loading