arenanet / api-cdi

Collaborative Development Initiative for Public APIs
253 stars 41 forks source link

Support empty parameters #24

Closed sliekens closed 9 years ago

sliekens commented 9 years ago

I think that bulk expanded endpoints are broken in the sense that an empty ids parameter is treated as if there was no query string at all.

An example...

https://api.guildwars2.com/v2/items?ids=

Is treated the same as...

https://api.guildwars2.com/v2/items

When I visit that first URL, I would expect one of two things:

Instead, the API returns an array of numeric values, when my program is expecting an array of objects.

lye commented 9 years ago

Seems reasonable enough to me. I'll make the change unless there's dissent, not sure when it'll go out though.

sliekens commented 9 years ago

Thanks! By the way, I think the same issue applies to pagination. Can't check right now, because our company firewall blocks your domain name.

https://api.guildwars2.com/v2/items?page=
tivac commented 9 years ago

This is written, pending code review from @lye. Both ?ids= and ?page= return a HTTP 400.

sliekens commented 9 years ago

Sweet :)

What about id=?

tivac commented 9 years ago

Good catch! ?id= returns HTTP 400 as well. @lye signed off, so checking this into dev.

lye commented 9 years ago

This is now live, as of this morning.