This is a spin-off question to query with filters
Say my application is managing objects called workload, with the following fields. I want to expose a REST interface for user to query workloads by labels.
"Workload": {"id":"test1", "labels":["A", "B", "C"]}
"Workload": {"id":"test2", "labels":["A", "C", "D"]}
"Workload": {"id":"test3", "labels":["A", "B", "D"]}
Question: How do I design the REST endpoint so that it would support query workload with basic logic operations?
Sample Query 2: I want to GET all the workloads with label "A" or "B" but no "C"
No clue how to do this sort of rest api at all, other than ask user to query by A, B, C separately then do proper set operations themselves? (What a great user experience...)
A similar question here touches upon query with boolean logic on different filters, but it doesn't seem applicable to repeated filter. (In this case, labels. It seems weird to do GET /workloads/labels:A/labels:B
)