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.
Bypass imports touch two separate endpoints:
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