-
Notifications
You must be signed in to change notification settings - Fork 142
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
Infringed constraint on array values causes a type-error #759
Labels
bug
Something isn't working
Comments
Thanks! I'll handle it |
Could you please test it with |
frictionless validate --schema array_with_contraints_schema.json array_sample.csv
# -------
# invalid: array_sample.csv
# -------
=== ===== ================ =================================================================================================================================================================
row field code message
=== ===== ================ =================================================================================================================================================================
4 1 constraint-error The cell "["a","b","c"]" in row at position "4" and field "field1" at position "1" does not conform to a constraint: array item constraint "enum" is "['a', 'b']"
5 1 constraint-error The cell "["c"]" in row at position "5" and field "field1" at position "1" does not conform to a constraint: array item constraint "enum" is "['a', 'b']"
=== ===== ================ ================================================================================================================================================================= Much, much better! Thanks @roll! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
I'm really excited to use the new feature to constraint array item values (see #627) but I face a problem with errors raised in the validation report.
Given
array_sample.csv
file:I wrote a first simple schema (
array_schema.json
file) to insure that field1 contains array values:I can check that my CSV file is ok:
Now, I want to go further and check that array items are only "a" or "b". I extend my schema using
arrayItem
property (array_with_contraints_schema.json
file):I don't understand why I get
type-error
errors. IMO these errors are not relative to type infrigement. Validate only on type (witharray_schema.json
) reveals no errors.Would it be possible to get
constraint-error
errors instead with a clearer message?Thx
Please preserve this line to notify @roll (lead of this repository)
The text was updated successfully, but these errors were encountered: