SchedulesDirect / JSON-Service

Code related to download, slice-and-dice and generation of JSON into database.
36 stars 5 forks source link

API 20141201 GET /lineups returns 400 Bad Request when no lineups have been added #62

Open karog opened 9 years ago

karog commented 9 years ago

GET /20141201/lineups returns 400 Bad Request when no lineups have been added.

Once a lineup has been added, the GET succeeds.

rkulagowski commented 9 years ago

Inside the bad request should be a code 4102 response:

"No lineups have been added to this account."

Are you not seeing the error coming back for the 400, or are you expecting a 200?

karog commented 9 years ago

I was expecting a 200 with an empty array. I think that is more natural. An empty array demonstrates no lineups added or last one was removed.

To me, a Bad Request implies an invalid request. The request to get the lineups is not invalid just because there aren't any at the moment. That would be like asking the size of an array and getting an error just because the array happened to be empty.

Asking for info ABOUT lineups when there aren't any should be an error but not just asking FOR the lineups.

rkulagowski commented 9 years ago

I'm using the thread over at http://forums.schedulesdirect.org/viewtopic.php?f=17&t=2678 for comments regarding the new API; I think that's the appropriate place to discuss, because changing the behavior in 20141201 would break existing clients.

karog commented 9 years ago

Thanks. I will post there from now on.