SpeedETab / bypass

0 stars 1 forks source link

Bypass import failure investigation #3

Open allolex opened 7 years ago

allolex commented 7 years ago

Bypass imports touch two separate endpoints:

  1. The concessions list.
  2. Menu endpoints for each concession.

Prior to this new error, when menus were retrieved, they came back as JSON strings as response.body. response.body now seems to be actually using the Faraday middleware to parse the JSON automatically when it was not doing this before. I think this may be because Bypass changed their response type to "application/json" or similar when they were not doing that before.

The bypass gem code: c.response :json, content_type: /\bjson$/ will parse a response as JSON if it has "json" in it, per the regular expression.

If that's the case, then we shouldn't have to use JSON.parse anywhere.

cc @elg1 @Joseworks

allolex commented 7 years ago

The Bypass gem needs tests.