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

clear errors from "additionalProperties: false" #2631

Closed

Conversation

Lausselloic
Copy link
Contributor

@Lausselloic Lausselloic commented Dec 10, 2021

Reasons for making this change

if additionalProperties is set to false omit extra data doesn't work as expected

Add a test to validate it. Before fixes test failed, after fix test success

Fixes #1507

Checklist

  • I'm updating documentation
  • I'm adding or updating code
    • I've added and/or updated tests
    • 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

@@ -16,8 +16,7 @@
"start": "concurrently \"npm:build:* -- --watch\"",
"tdd": "cross-env NODE_ENV=test mocha --require @babel/register --watch --require ./test/setup-jsdom.js test/**/*_test.js",
"test": "cross-env BABEL_ENV=test NODE_ENV=test mocha --require @babel/register --require ./test/setup-jsdom.js test/**/*_test.js",
"test-coverage": "cross-env NODE_ENV=test nyc --reporter=lcov mocha --require @babel/register --require ./test/setup-jsdom.js test/**/*_test.js",
"test-debug": "cross-env NODE_ENV=test mocha --require @babel/register --require ./test/setup-jsdom.js --debug-brk --inspect test/Form_test.js"
Copy link
Member

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've added the test-debug to work on dedicated Form_test and commit it by accident.

Copy link
Member

Choose a reason for hiding this comment

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

Honestly, it is actually a nice add! I'd suggest keeping it

@heath-freenome
Copy link
Member

@Lausselloic in the upcoming @rjsf v5 release the utils.js and validator.js files have been refactored into their own packages (see the rjsf-v5 branch). If you feel that this change is critical, I encourage you to port it onto that branch.

Lausselloic added a commit to Lausselloic/react-jsonschema-form that referenced this pull request Jul 19, 2022
Lausselloic added a commit to Lausselloic/react-jsonschema-form that referenced this pull request Jul 22, 2022
…set to false in schema

# Conflicts:
#	packages/utils/src/schema/toPathSchema.ts
#	packages/utils/test/schema/toPathSchemaTest.ts
Lausselloic added a commit to Lausselloic/react-jsonschema-form that referenced this pull request Jul 29, 2022
…set to false in schema

# Conflicts:
#	packages/utils/src/schema/toPathSchema.ts
#	packages/utils/test/schema/toPathSchemaTest.ts
heath-freenome added a commit that referenced this pull request Aug 19, 2022
…lse (#2940)

* backport PR #2631 to take into account additionalProperties set to false in schema

# Conflicts:
#	packages/utils/src/schema/toPathSchema.ts
#	packages/utils/test/schema/toPathSchemaTest.ts

* move to fix from #2853

* fix linting error

* run cs-format on modified files

* Update packages/utils/src/schema/toPathSchema.ts

Fix formatting (hopefully)

* Update packages/utils/src/schema/toPathSchema.ts

Second try fixing formatting

Co-authored-by: LAUSSEL Loic INNOV/IT-S <SFCJ5514@orange.com>
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
heath-freenome added a commit to heath-freenome/react-jsonschema-form that referenced this pull request Aug 27, 2022
…set to false (rjsf-team#2940)

* backport PR rjsf-team#2631 to take into account additionalProperties set to false in schema

# Conflicts:
#	packages/utils/src/schema/toPathSchema.ts
#	packages/utils/test/schema/toPathSchemaTest.ts

* move to fix from rjsf-team#2853

* fix linting error

* run cs-format on modified files

* Update packages/utils/src/schema/toPathSchema.ts

Fix formatting (hopefully)

* Update packages/utils/src/schema/toPathSchema.ts

Second try fixing formatting

Co-authored-by: LAUSSEL Loic INNOV/IT-S <SFCJ5514@orange.com>
Co-authored-by: Heath C <51679588+heath-freenome@users.noreply.github.com>
@heath-freenome
Copy link
Member

heath-freenome commented Aug 28, 2022

Fixed in v5 beta via #2940, see the 5.x migration guide

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.

liveOmit does not clear errors from "additionalProperties: false" until formData change
2 participants