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

Unable to add new item for object with additionalProperties within anyOf / oneOf with liveOmit and omitExtraData #4366

Open
4 tasks done
UsainBloot opened this issue Nov 5, 2024 · 2 comments

Comments

@UsainBloot
Copy link

UsainBloot commented Nov 5, 2024

Prerequisites

What theme are you using?

core

Version

5.x

Current Behavior

When liveOmit and omitExtraData options are enabled, then you are unable to add a new item to an object that uses additionalProperties within an anyOf or oneOf.

Example json schema

{
  "oneOf": [
    {
      "type": "object",
      "additionalProperties": {
        "foo": {
          "type": "string"
        }
      }
    }
  ]
}

RJSF options

liveOmit: true
omitExtraData: true

Expected Behavior

Can add new items

Steps To Reproduce

  1. Visit playground
  2. Try and add a new item

Environment

Playground

Anything else?

No response

@UsainBloot UsainBloot added bug needs triage Initial label given, to be assigned correct labels and assigned labels Nov 5, 2024
@nickgros
Copy link
Contributor

nickgros commented Nov 8, 2024

Thanks for the report, @UsainBloot. We should probably not remove properties from objects that allow additionalProperties when omitExtraData is true.

We maintainers have limited time to get to all of the issues, so would you be interested in looking into fixing this?

@nickgros nickgros added help wanted additionalProperties and removed needs triage Initial label given, to be assigned correct labels and assigned labels Nov 8, 2024
@UsainBloot
Copy link
Author

Hi @nickgros, I think this PR would solve the issue
#3714

As it seems related to #3711 and #4314

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

No branches or pull requests

2 participants