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

Query for dictionary keys inside a collection in mixed doesn't work #7283

Closed
nirinchev opened this issue Jan 23, 2024 · 4 comments
Closed

Query for dictionary keys inside a collection in mixed doesn't work #7283

nirinchev opened this issue Jan 23, 2024 · 4 comments
Assignees

Comments

@nirinchev
Copy link
Member

I have the following query: ANY oneAny[*].foo.@keys == 'child' which throws the following exception:

The keypath following 'ANY' must contain a list. Error code: 1009.

oneAny is a mixed property. In my test, it contains a collection, where one of the elements is a dictionary. In 2 test objects, the value for foo is a string and in 1 test object, the value is a dictionary with one of the keys being child. I would expect the query to match the 3rd object.

@jedelbo
Copy link
Contributor

jedelbo commented Feb 5, 2024

@nirinchev A quick question: If you remove ANY, does it then work?

@nirinchev
Copy link
Member Author

Hey @jedelbo, yes, removing ANY fixes it.

@jedelbo
Copy link
Contributor

jedelbo commented Feb 6, 2024

So in this case you could say that ANY is redundant, but I found other cases where it made sense, so a fix was required.

@jedelbo
Copy link
Contributor

jedelbo commented Feb 9, 2024

Fixed by #7318

@jedelbo jedelbo closed this as completed Feb 9, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants