Repository navigation
Fix root falsy formData failing validation - #5423
Merged
heath-freenome merged 3 commits intoOct 2, 2026
Merged
heath-freenome merged 3 commits into
heath-freenome merged 3 commits into
Conversation
Comment on lines
23
to
24
| - Fixed `Form` failing validation with `must be boolean` (or the matching type error) when the root `formData` is a falsy value such as `false`, `0` or `''`. Only `undefined` is now treated as missing before validating, fixes [#5404](https://github.com/rjsf-team/react-jsonschema-form/issues/5404) ([#5423](https://github.com/rjsf-team/react-jsonschema-form/pull/5423)) | ||
| - Updated `markdown-to-jsx` from `^9.8.2` to `^9.10.3` ([#5420](https://github.com/rjsf-team/react-jsonschema-form/pull/5420)) |
Member
There was a problem hiding this comment.
Put this after existing entries
Suggested change
| - Fixed `Form` failing validation with `must be boolean` (or the matching type error) when the root `formData` is a falsy value such as `false`, `0` or `''`. Only `undefined` is now treated as missing before validating, fixes [#5404](https://github.com/rjsf-team/react-jsonschema-form/issues/5404) ([#5423](https://github.com/rjsf-team/react-jsonschema-form/pull/5423)) | |
| - Updated `markdown-to-jsx` from `^9.8.2` to `^9.10.3` ([#5420](https://github.com/rjsf-team/react-jsonschema-form/pull/5420)) | |
| - Updated `markdown-to-jsx` from `^9.8.2` to `^9.10.3` ([#5420](https://github.com/rjsf-team/react-jsonschema-form/pull/5420)) | |
| - Fixed `Form` failing validation with `must be boolean` (or the matching type error) when the root `formData` is a falsy value such as `false`, `0` or `''`. Only `undefined` is now treated as missing before validating, fixing [#5404](https://github.com/rjsf-team/react-jsonschema-form/issues/5404) |
Contributor
Author
There was a problem hiding this comment.
Done, moved the entry below the markdown-to-jsx line, used your wording and dropped the PR link. Thanks Heath.
Contributor
Size limit reportSizes are minified + brotli, measured by size-limit at A package listed twice is measured both as installed and, on the second row, as its own code with its dependencies excluded. Peer dependencies are always excluded.
|
heath-freenome
approved these changes
Oct 2, 2026
3 of 8 tasks
jimmycallin
pushed a commit
to jimmycallin/react-jsonschema-form
that referenced
this pull request
Oct 7, 2026
Brings in the main changes v7 did not already have from the earlier squashed syncs (rjsf-team#5290, rjsf-team#5376, rjsf-team#5422): - rjsf-team#5423: validate a falsy root formData (`false`, `0`, `''`) instead of treating it as missing, ported into v7's validateFormData() - rjsf-team#5435: detect $ref cycles with a path-scoped recursion stack in retrieveSchema(), ported onto v7's SchemaContext signatures; its tests are adapted to `{ validator }` contexts and v7's stricter lint rules - CHANGELOG.md taken from main (adds the 6.11.1 section) Everything else main changed since 6.10.0 was already on v7, so those files keep v7's content, including v7's theme snapshots. This is a real merge so the merge base moves forward to main's tip. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reasons for making this change
Form.validate()used a truthy check when copying the rootformData, so a falsy root value (false,0,'') was treated as missing and validated asundefined. A form withtype: booleanand a value offalsefailed withmust be booleanand could never submit. Onlyundefinednow skips the copy.fixes #5404
Tests:
it.eachcases inpackages/core/test/Form.handlers.test.tsxfor rootfalse,true,0, integer0and'', plus a wrong-type negative case. The new cases that cover falsy values fail without the fix (16 failures on base).Verification (author's run, I did not re-run it):
vitestforpackages/core: 2106 passed, 0 failed.tscbuild, theme/snapshot/utils/validator suites (code untouched), and a browser check in the playground.Checklist
pnpm run test:update; no snapshots are affected.