Closed vheuken closed 7 years ago
@vheuken the Open Weather API returns the response as "404" string. So I don't think we should fix it at our end, as thats not the expected behavior. We can let the Open Weather Map, people know about this issue and ask them for their feedback.
@vheuken any reason why you feel this is an edge case which should be handled?
any reason why you feel this is an edge case which should be handled?
Consistency. It's what the end user expects.
So I don't think we should fix it at our end, as thats not the expected behavior.
Are you sure about this? If it is explicitly documented saying that a "404" will be a string and a 200 will be an integer, I can see where you're coming from. I don't think it's beyond the scope of an API wrapper to work around API bugs and "gotchyas", though. After all, if I wanted to deal with API quirks, I'd just interact with the API directly.
We can let the Open Weather Map, people know about this issue and ask them for their feedback.
This would be a good idea. I will do that this weekend.
@vheuken I mailed them yesterday and I got this reply from them.
Dear Mr. Harisankar,
thank you for using our services and reporting the problem! I will add this to our internal bug tracker. Sorry for temporary inconvenience. Best regards, Ivan Mashchenko
Regarding this:
Consistency. It's what the end user expects.
I am kinda biased here, if a guy who has already been working with the API, uses our wrapper and expects a string 404 and gets an integer 404, then it would be an issue.
As a wrapper we just need to let developers communicate with an API through Ruby syntax, and leave the rest to the API. Unless its a huge usability issues with the API.
So I feel it would be better for the API to fix it, since they have added it to their Internal Bug Tracker. Hopefully the developers there will fix it, or they will let us know why it can not be changed.
if a guy who has already been working with the API, uses our wrapper and expects a string 404 and gets an integer 404, then it would be an issue.
While I doubt that that would be a real issue in practice, I think your stance on the responsibilities of an API is reasonable. Hopefully they end up fixing this on their end.
On a 404, the response code is a string. On a 200, the response code is an Integer.