allieIsOkay / allieIsOkay/quantified-self-api
Add meal show endpoint
- Vorherrschende Sprache
- JavaScript
- Sterne
- 0
- Forks
- 0
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
As a user,
I should be able to request the information for a specific meal in the system by submitting a GET request to the endpoint '/api/v1/meals/:meal_id/foods' where :meal_id is the ID of a meal in the system.
A valid response should carry a 200 status code and be formatted as follows:
```
{
"id": 1,
"name": "Breakfast",
"foods": [
{
"id": 1,
"name": "Banana",
"calories": 150
},
{
"id": 6,
"name": "Yogurt",
"calories": 550
},
{
"id": 12,
"name": "Apple",
"calories": 220
}
]
}
```
In the event that an invalid meal id is provided, the response should carry a 404 status, and indicate that the meal was not found:
```
{
"error": "Meal not found"
}
```
- [x] Tested
- [x] Documented
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.