Skip to content
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

fix: Fixes #3805 by copying schema props rather than directly updating them #3806

Merged
merged 2 commits into from
Aug 2, 2023

Conversation

heath-freenome
Copy link
Member

Reasons for making this change

Fixes #3805 by using object spread of schema changes rather than direct updating of schema properties

  • In @rjsf/utils, updated resolveAllReferences() to copy updated schema properties rather than directly changing them to avoid issues with frozen schemas
  • In @rjsf/material-ui, removed the unnecessary import of the @types/material-ui which was causing typescript issues in some situations

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests. I've run npm run test:update to update snapshots, if needed.
    • I've updated docs if needed
    • I've updated the changelog with a description of the PR
  • I'm adding a new feature
    • I've updated the playground with an example use of the feature

Copy link
Member

@epicfaace epicfaace left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good -- should we add a test to replicate the #3805 issue?

@nickgros
Copy link
Contributor

nickgros commented Aug 2, 2023

Ditto @epicfaace -- just a simple case where we pass a deeply frozen object would suffice IMO

…y updating them

Fixes rjsf-team#3805 by using object spread of schema changes rather than direct updating of schema properties

- In `@rjsf/utils`, updated `resolveAllReferences()` to copy updated schema properties rather than directly changing them to avoid issues with frozen schemas
- In `@rjsf/material-ui`, removed the unnecessary import of the `@types/material-ui` which was causing typescript issues in some situations
@heath-freenome
Copy link
Member Author

Ditto @epicfaace -- just a simple case where we pass a deeply frozen object would suffice IMO

@nickgros @epicfaace I deep froze all of the test schemas ;)

@heath-freenome heath-freenome merged commit 23056cb into rjsf-team:main Aug 2, 2023
@heath-freenome heath-freenome deleted the fix-3805 branch August 2, 2023 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ResolveAllReferences fails with a deeply frozen schema
4 participants