I hesitate to claim this is the “best” approach, but here’s where I would start with this one. First, I see this as two different cases, and because of that I would approach this two different ways.
In the first, where we are searching for people of specific ages (array case), I would just use multiple age parameters, e.g.
GET /people?age=10&age=20&age=30
In the second, where we are searching for people within a range of ages, I would use two different query parameters, e.g.
GET /people?minage=10&maxage=45
I like this because I think it’s harder to make a mistake. I don’t need to remember a specific convention, etc.
Sure, I think that would be restful. It’s still cacheable, doesn’t misuse http methods, etc. I think you could still make that happen with the other method, but it wouldn’t be as compact. Depending on how much filtering you need to do on people you might want to consider something more powerful, for example passing in a query via a “q” parameter or something… GET /people?q=(age > 10 and age < 30) or age = 40 (url encoded naturally).. that’s going to get more complex on the implementation side but if you have a ton of variety you want to support it might be hard to find a nice set of query params that enable that. All depends on the use case, I guess. It’s all about finding the right level of “simple” I think.
B. Your question seems to be exactly the same as the original question here. What is different? Please don’t answer that here. Provide this information when you ask the new question.
C. What did you not like about the original, accepted answer from three years ago? It’s possible that this answer is inappropriate for you. If so, explain why? Again, not here. In the new question.