Reputation: 1397
I have a situation where I have nested multi-select.
1.Football
1.1 Messi
1.2 Ronaldo
1.3 Neymar
2. Tenis
2.1 Novak Djokovic
2.2 Fedrer
2.3 Messi
and I want to create an endpoint for this query which can fetch multiplayer. If it would be just one single select in-game and single select in the player then I could do
?game=tennis&player=Messi
?game=Football&player=Messi
But I need a single endpoint which can fetch multiplayer in multiple games. Please suggest
Upvotes: 1
Views: 32
Reputation: 130957
Not sure if I properly understand what your issue is, but you could do:
?game=tennis,football&player=messi,fedrer
?game=tennis&game=football&player=messi&player=fedrer
But you must be aware that, the query string, by definition, is non-hierarchical:
The query component contains non-hierarchical data that, along with data in the path component, serves to identify a resource within the scope of the URI's scheme and naming authority (if any). The query component is indicated by the first question mark (
?
) character and terminated by a number sign (#
) character or by the end of the URI. [...]
Upvotes: 1