You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When filtering on multiple tags, by defining them as a comma separated list, as suggested by the oh-repeater documentation, there are no results returned.
Expected behavior
The expected return are all rules that match the combination of tags specified.
Steps to reproduce
- component: oh-repeater
config:
for: scene
sourceType: rulesWithTags
ruleTags: TagA,TagB
Results in the following API call: GET /rest/rules?summary=true&tags=TagA,TagB
Which does not return rules (scenes in my case) tagged with both TagA and TagB, but no results at all.
If only a single tag is specified this works as documented.
Looking at the initial PR for this feature (#1724), it seems that the rulesWithTags is implemented the same way as itemsWithTags. However when looking into the API exporer to build these backend calls by hand, they seem to differ.
Example for items with multiple tags, which indeed seems to use coma separation: /rest/items?tags=Measurement,Level
Example for rules, which seems to expect the same query parameter multiple times: /rest/rules?tags=Scene&tags=TagA&tags=TagB
Doing a bit of query injection in the oh-repeater seems to confirm this suspicion.
- component: oh-repeater
config:
for: scene
sourceType: rulesWithTags
ruleTags: 'TagA&tags=TagB'
Returns the expected results, and the following API call: GET /rest/rules?summary=true&tags=TagA&tags=TagB
The text was updated successfully, but these errors were encountered:
The problem
When filtering on multiple tags, by defining them as a comma separated list, as suggested by the
oh-repeater
documentation, there are no results returned.Expected behavior
The expected return are all rules that match the combination of tags specified.
Steps to reproduce
Results in the following API call:
GET /rest/rules?summary=true&tags=TagA,TagB
Which does not return rules (scenes in my case) tagged with both TagA and TagB, but no results at all.
If only a single tag is specified this works as documented.
Your environment
Additional information
Looking at the initial PR for this feature (#1724), it seems that the
rulesWithTags
is implemented the same way asitemsWithTags
. However when looking into the API exporer to build these backend calls by hand, they seem to differ.Example for items with multiple tags, which indeed seems to use coma separation:
/rest/items?tags=Measurement,Level
Example for rules, which seems to expect the same query parameter multiple times:
/rest/rules?tags=Scene&tags=TagA&tags=TagB
Doing a bit of query injection in the oh-repeater seems to confirm this suspicion.
Returns the expected results, and the following API call:
GET /rest/rules?summary=true&tags=TagA&tags=TagB
The text was updated successfully, but these errors were encountered: