pennlabs / penn-sdk-python

A Python module for the various services of Penn OpenData. Validated API token required.
MIT License
30 stars 5 forks source link

Dining V2 Malformatted #93

Open joshdoman opened 6 years ago

joshdoman commented 6 years ago

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.

ezwang commented 6 years ago

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

joshdoman commented 6 years ago

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

ezwang commented 6 years ago

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"
        }
    ]
}
andrewsi10 commented 6 years ago

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.