Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix 3711 anyOf/oneOf remove old fields from previous schema #3714

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

Open
cwendtxealth wants to merge 2 commits into rjsf-team:main
base: main
Choose a base branch
Loading
from cwendtxealth:fixes-3711-anyOf-oneOf-remove-old-fields

Conversation

@cwendtxealth
Copy link
Contributor

@cwendtxealth cwendtxealth commented Jun 1, 2023
edited
Loading

Reasons for making this change

Fixes #3711 - removing old undefined fields when switching to different oneOf/anyOf schema

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

});

newFormData = {
...data,
Copy link
Member

@heath-freenome heath-freenome Jun 1, 2023

Choose a reason for hiding this comment

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

@cwendtxealth These changes are very similar to #3443 (comment). In that PR I requested the developer to ensure that none of the other issues were regressed. Are you willing to do that legwork?

Copy link
Contributor Author

@cwendtxealth cwendtxealth Jun 1, 2023

Choose a reason for hiding this comment

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

Yeah I should be able to validate those issues if they have reproducible steps

heath-freenome reacted with hooray emoji
Copy link
Contributor Author

@cwendtxealth cwendtxealth Jun 3, 2023

Choose a reason for hiding this comment

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

Just from some initial testing it does look like removing some undefined fields causes some issues with how getDefaultFormState fills out formData. Might need to look at a different place to remove the undefined fields.

Copy link
Member

@heath-freenome heath-freenome Jun 7, 2023

Choose a reason for hiding this comment

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

@cwendtxealth I'm on vacation for a week starting today. My thoughts are that, perhaps we add another flag to the experimental_defaultFormStateBehavior that deals with this behavior somehow.

cwendtxealth reacted with thumbs up emoji
Copy link
Member

@heath-freenome heath-freenome Aug 4, 2023

Choose a reason for hiding this comment

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

Maybe we talk about this at one of the Friday meetings?

Copy link
Contributor Author

@cwendtxealth cwendtxealth Aug 4, 2023

Choose a reason for hiding this comment

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

That sounds good!

Copy link

linpc commented Aug 25, 2023

Hello, any update on this fix? Thanks!

michal-kurz reacted with eyes emoji

Copy link
Member

@linpc This is a very tricky problem that @cwendtxealth hasn't quite figured out how to fix yet.

Copy link
Contributor

Hey @cwendtxealth, @heath-freenome , any predictions on when this might get merged? No pressure, but our workaround for this is giving us some performance issues, so we need to decide if it's worth optimizing.

Copy link

Hi @michal-kurz , would you mind sharing your workaround?

Copy link

Bonfims commented Apr 24, 2024

thank you all, just a doubt: it will work on conditionally remove a field with "if" without anyOf or oneOf?

Copy link

Thanks for contributing this, I believe it would fix my issue raised in #4366

Copy link
Member

@cwendtxealth Any chance you can figure out 1) whether this PR is still needed given all the changes and features added to v6? and 2) if so, how can we help you get it over the line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@heath-freenome heath-freenome heath-freenome left review comments

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

anyOf/oneOf keeping undefined property of old option

AltStyle によって変換されたページ (->オリジナル) /