rjsf-team/react-jsonschema-form

Empty anyOf invalid schema on first validation

Open

#3 933 ouverte le 31 oct. 2023

Voir sur GitHub
 (3 commentaires) (0 réactions) (0 assignés)TypeScript (2 136 forks)batch import
bughelp wantedvalidation

Métriques du dépôt

Stars
 (13 175 stars)
Métriques de merge PR
 (Merge moyen 3j 17h) (32 PRs mergées en 30 j)

Description

Prerequisites

What theme are you using?

core

Version

5.13.2

Current Behavior

An object with a property of type ["string", "null"] (foo in the example) that uses an empty anyOf has an invalid schema on the first validation, on subsequent validations the schema is valid. It does not matter if you use AJV raw validation or the RJSF validate button in the playground. The invalid schema error shows on the first of either, and not on subsequent of both.

Interestingly in the AJV raw validate the first validation returns:

{ "validationError": {} }

Expected Behavior

The schema should not be invalid on the first validation.

Steps To Reproduce

Here is a playground link

Must refresh to get "first" validation issue.

Environment

- OS: macOS 14.0
- Node: 16.20.1
- npm: 8.19.4

Anything else?

No response

Guide contributeur