penn-sdk-python icon indicating copy to clipboard operation
penn-sdk-python copied to clipboard

Dining V2 Malformatted

Open joshdoman opened this issue 7 years ago • 4 comments

See here: https://api.pennlabs.org/dining/v2/venues. Some of the "menu" fields are a JSON object and some are an array of JSON objects. They should all be an array of JSON objects, even if there is only one item.

This explains the discrepancy between https://api.pennlabs.org/dining/v2/venues and https://api.pennlabs.org/dining/venues.

joshdoman avatar Feb 11 '18 16:02 joshdoman

@andrewsi10 Would this break anything on the android version of the app if we made this change?

ezwang avatar Feb 11 '18 18:02 ezwang

@ezwang Can't speak to Android but for iOS it would not. We are not using v2 for our dining API.

joshdoman avatar Feb 11 '18 18:02 joshdoman

For example, in v2 for Pret a Manger has the following:

{
    date: "2018-02-12",
    meal: {
        close: "16:00:00",
        open: "08:00:00",
        type: "Pret a Manger"
    }
}

while the original endpoint gives:

{
    date: "2018-02-12",
    meal: [
        {
            close: "16:00:00",
            open: "08:00:00",
            type: "Pret a Manger"
        }
    ]
}

ezwang avatar Feb 11 '18 19:02 ezwang

I can confirm that the Android version does not use v2 for the dining API. The Android app would break if the meal was an object instead of a list.

andrewsi10 avatar Feb 12 '18 00:02 andrewsi10