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

mapStateToAnyOfProps -> mapStateToCombinatorRendererProps StructuralKeywords should include const #1787

Closed
richturner opened this issue Jul 20, 2021 · 3 comments · Fixed by #1788

Comments

@richturner
Copy link
Contributor

richturner commented Jul 20, 2021

Describe the bug

Currently the mapStateToCombinatorRendererProps function does not consider a validation error relating to a const constraint as invalid and therefore the incorrect indexOfFittingSchema can be returned.

Expected behavior

A const validation failure should be invalid and therefore indexOfFittingSchema should move onto the next schema for validation.

StructuralKeywords should include const

Steps to reproduce the issue

Use a schema containing an anyOf array with const constraints and the indexOfFittingSchema will always return 0

Screenshots

No response

In which browser are you experiencing the issue?

Google Chrome 91.0.4472.164

Framework

No response

RendererSet

No response

Additional context

No response

@richturner richturner changed the title mapStateToAnyOfProps StructuralKeywords should include const mapStateToAnyOfProps -> mapStateToCombinatorRendererProps StructuralKeywords should include const Jul 20, 2021
@sdirix
Copy link
Member

sdirix commented Jul 21, 2021

Thanks for the report! Would you be willing to contribute the change including a test case? This would be the fastest way to get the change in.

@richturner
Copy link
Contributor Author

Pull request created; I couldn't get the tests to compile without switching this import:

import { setValidationMode } from '../../lib';

to :

import { setValidationMode } from '../../src/actions';

Don't know where lib comes from? I reverted this change in the PR but wanted to make you aware.

@sdirix
Copy link
Member

sdirix commented Jul 23, 2021

lib is the output directory of our build. So switching the import path is certainly the right thing to do for the tests. Maybe this came in via the editor's auto import feature.

@sdirix sdirix modified the milestones: next, 3.0 Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants