from_response

models.MealDetails.from_response(data, key='meals')

Create an instance from an API response, handling null meal data.

Parameters

Name Type Description Default
data dict The API response dictionary. required
key str The key to extract from the response. Defaults to ‘meals’. 'meals'

Returns

Name Type Description
MealDetails Instance with meals populated, or empty list if meals is None.