-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursive definition no longer works in 5.4 #3560
Labels
Comments
@Assumeru Wow, yeah, we might have broken infinite recursion checking in the 5.x release. I will see how easy it is to fix it in the next week or so |
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Apr 3, 2023
Fixes rjsf-team#3560 by preventing infinite recursion on `$ref`s - In `@rjsf/utils` added infinite recursion protection in the `toIdSchema()`, `toPathSchema()` and `getDefaultFormState()` functions - Added tests to verify that no infinite recursion due to `$ref`s happen for those three functions along with `retrieveSchema()` - Fixed the console.log() call for the `mergeAllOf` exceptions to log the whole error rather than the toString of it - Updated the `CHANGELOG.md` file accordingly
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Apr 3, 2023
Fixes rjsf-team#3560 by preventing infinite recursion on `$ref`s - In `@rjsf/utils` added infinite recursion protection in the `toIdSchema()`, `toPathSchema()` and `getDefaultFormState()` functions - Added tests to verify that no infinite recursion due to `$ref`s happen for those three functions along with `retrieveSchema()` - Fixed the console.log() call for the `mergeAllOf` exceptions to log the whole error rather than the toString of it - Updated the `CHANGELOG.md` file accordingly
8 tasks
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Apr 3, 2023
Fixes rjsf-team#3560 by preventing infinite recursion on `$ref`s - In `@rjsf/utils` added infinite recursion protection in the `toIdSchema()`, `toPathSchema()` and `getDefaultFormState()` functions - Added tests to verify that no infinite recursion due to `$ref`s happen for those three functions along with `retrieveSchema()` - Fixed the console.log() call for the `mergeAllOf` exceptions to log the whole error rather than the toString of it - Updated the `CHANGELOG.md` file accordingly
heath-freenome
added a commit
to heath-freenome/react-jsonschema-form
that referenced
this issue
Apr 4, 2023
Fixes rjsf-team#3560 by preventing infinite recursion on `$ref`s - In `@rjsf/utils` added infinite recursion protection in the `toIdSchema()`, `toPathSchema()` and `getDefaultFormState()` functions - Added tests to verify that no infinite recursion due to `$ref`s happen for those three functions along with `retrieveSchema()` - Fixed the console.log() call for the `mergeAllOf` exceptions to log the whole error rather than the toString of it - Updated the `CHANGELOG.md` file accordingly
heath-freenome
added a commit
that referenced
this issue
Apr 4, 2023
* fix: Fixed infinite ref recursion in some utils functions Fixes #3560 by preventing infinite recursion on `$ref`s - In `@rjsf/utils` added infinite recursion protection in the `toIdSchema()`, `toPathSchema()` and `getDefaultFormState()` functions - Added tests to verify that no infinite recursion due to `$ref`s happen for those three functions along with `retrieveSchema()` - Fixed the console.log() call for the `mergeAllOf` exceptions to log the whole error rather than the toString of it - Updated the `CHANGELOG.md` file accordingly * - Removed the defaults on the internal functions and in the case of `toIdPrefixInternal()` reordered the props from the public API that are provided with defaults - This fixes test coverages * - Fixed #2593 fully by also supporting data in `formData` in addition to data in `default` when dealing with `additionalProperties`
The playground hangs for me with: {
"title": "A registration form",
"description": "A simple form example.",
"type": "object",
"properties": {
"child": {
"$ref": "#"
}
}
} |
@estk can you please write a new issue for this very extreme edge case so we can fix it? |
Open
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
What theme are you using?
material-ui
Version
5.4.0
Current Behavior
A definition containing an array of which each array item is defined to be another instance of this definition leads to infinite recursion. Aside from the browser slowing down, a message gets logged in the console:
could not merge subschemas in allOf: InternalError: too much recursion
.Expected Behavior
This same schema works fine in version 4.2, i.e. it doesn't recurse endlessly.
Steps To Reproduce
Paste this schema into https://rjsf-team.github.io/react-jsonschema-form/
Playground Link
Environment
No response
Anything else?
I see a few other, older issues on the tracker that look similar, but these all appear to be from before version 5. #1160 appears to be about a nearly identical schema causing a similar issue along a different code path.
The text was updated successfully, but these errors were encountered: