def get_objects_from_response(response, expression=None, as_list=False):
    """
    Return list of dicts representing json decoded objects. Supports only json response.

    :param response: `requests.Response` instance
    :param expression: javascript expression for extracting objects. `response` is assumed to be existing variable
    in scope holding value of `response` object. Note: only property accessor dot notation is supported.
    """
    if expression is None:
        expression = 'response'
    json = {'response': response.json()}
    properties = expression.split('.')
    while properties:
        prop = properties.pop(0)
        json = json[prop]

    # Convert to a list if necessary
    if not isinstance(json, list) and as_list:
        return [json]
    return json