def parse_params(func, params, models):
    """
    get spec for (query, headers, cookies)
    """
    if hasattr(func, 'query'):
        params.append({'name': func.query, 'in': 'query', 'required': True,
            'schema': {'$ref': f'#/components/schemas/{func.query}'}})
    if hasattr(func, 'headers'):
        headers = models[func.headers]
        for key, value in headers['properties'].items():
            params.append({'name': key, 'in': 'header', 'type': value[
                'type'], 'required': key in headers['required']})
    if hasattr(func, 'cookies'):
        cookies = models[func.cookies]
        for key, value in cookies['properties'].items():
            params.append({'name': key, 'in': 'cookie', 'type': value[
                'type'], 'required': key in cookies['required']})
    return params
