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

[IMP] runtime: allow validating object values using a type description #1395

Merged
merged 1 commit into from
Apr 6, 2023

Conversation

sdegueldre
Copy link
Contributor

@sdegueldre sdegueldre commented Apr 5, 2023

In JS, objects are often used as a mapping that gives fast lookup on the keys, in those cases, the keys themselves are not known in advance, but the values may have a shape that they're expected to follow. This commit adds support for a values key in schema for objects, which will be checked against all values in the object during validation.

@sdegueldre sdegueldre linked an issue Apr 5, 2023 that may be closed by this pull request
@sdegueldre sdegueldre force-pushed the master-add-value-validation-sad branch 2 times, most recently from e035417 to 9992a6c Compare April 5, 2023 06:29
Copy link
Contributor

@ged-odoo ged-odoo left a comment

Choose a reason for hiding this comment

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

very nice. i just left a small comment

doc/reference/props.md Show resolved Hide resolved
In JS, objects are often used as a mapping that gives fast lookup on the
keys, in those cases, the keys themselves are not known in advance, but
the values may have a shape that they're expected to follow. This commit
adds support for a `values` key in schema for objects, which will be
checked against all values in the object during validation.
@sdegueldre sdegueldre force-pushed the master-add-value-validation-sad branch from 9992a6c to 37aaf57 Compare April 6, 2023 05:35
@ged-odoo ged-odoo merged commit 4700991 into master Apr 6, 2023
@ged-odoo ged-odoo deleted the master-add-value-validation-sad branch April 6, 2023 06:58
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.

Support element/key for object types during prop validation
2 participants