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

Feature: Add new prop duplicateKeySuffixSeparator for additionalProperties #3048

Merged
merged 5 commits into from
Aug 26, 2022

Conversation

nickgros
Copy link
Contributor

@nickgros nickgros commented Aug 26, 2022

Reasons for making this change

This was originally done in #2467, porting to v5 here.

When using additionalProperties and a duplicate property key is added, RJSF automatically changes the duplicate key from e.g. collision to collision-1.

I have a use case where we use additionalProperties, but - is an illegal character for our property keys. I added a FormProp duplicateKeySuffixSeparator to override - with any string.

Couple of questions

  • Is there a better/less verbose prop name?
  • This could be added to the uiSchema to change the separator per object field. I do not need this for my use case, but it's a potential change that could be made.

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

@nickgros nickgros changed the title Add new prop duplicateKeySuffixSeparator for additionalProperties Feature: Add new prop duplicateKeySuffixSeparator for additionalProperties Aug 26, 2022
@nickgros
Copy link
Contributor Author

Review: will move to uiSchema, keeping separate from idSeparator because idSeparator implies hierarchy and duplicateKeySuffixSeparator does not).

@heath-freenome
Copy link
Member

@nickgros go ahead and merge this!

@nickgros nickgros merged commit e3edba7 into rjsf-team:rjsf-v5 Aug 26, 2022
@nickgros nickgros mentioned this pull request Aug 26, 2022
7 tasks
heath-freenome pushed a commit to heath-freenome/react-jsonschema-form that referenced this pull request Aug 27, 2022
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.

2 participants