rjsf-team/react-jsonschema-form

if-then in allOf is not working when additionalProperties is set to false

Fechada

#3.251 aberto em 16 de nov. de 2022

 (3 comentários) (0 reação) (0 responsável)TypeScript (2.136 forks)batch import
any-one-all-ofbughelp wantedif-then-else

Métricas do repositório

Stars
 (13.175 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

Let's take an example: playground

The schema has "additionalProperties" set to false and "abc" enum property, then we have "allOf" section with 2 conditions for "abc", each of them should add some new, required property, but it is not rendering, unless "additionalProperties" is removed or set to true. Even though they are not shown, the validation is executed against them and it fails.

Expected Behavior

The schema from above should add properties that are conditionally configured in "allOf" section even when "additionalProperties" is set to false, so they can be filled.

Steps To Reproduce

  1. On this playground
  2. Select "value1" or "value2" in "abc" field
  3. Execute validation

Environment

- OS: Windows 10
- Browser: Chrome

Anything else?

No response

Guia do colaborador