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

enum constraint does not validate array items for type: "array" #1718

Open
pierrecamilleri opened this issue Dec 11, 2024 · 1 comment
Open

Comments

@pierrecamilleri
Copy link
Collaborator

pierrecamilleri commented Dec 11, 2024

With a schema specifying an enum constraint on a field of type array, the enum constraints does not validate the array items but the whole array value.

Expected behavior

Array items should be validated against the enum constraint.

Data to reproduce

schema.json

{
  "fields": [
    {
      "name": "foo",
      "type": "array",
      "constraints": {
        "enum": ["A", "B"]
      }
    }
  ]
}

data.csv

foo
"[""1"",""2""]"
"[""A"",""B""]"
frictionless --version
 # 5.18.0
@pierrecamilleri
Copy link
Collaborator Author

pierrecamilleri commented Dec 11, 2024

Actually, after rereading the spec for array and enum, there is no hint to the enum constraint being supported in this way in the table schema v2 spec.

@pierrecamilleri pierrecamilleri changed the title enum constraint is not taken into account for type: "array" enum constraint does not validate array items for type: "array" Dec 11, 2024
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

No branches or pull requests

1 participant