def METHOD_NAME(name, location_attr, description, required, type):
    """
    Created to avoid needing to directly access openapi within ViewSets.
    Ideally, the cases below will be used instead of this one.
    """
    return openapi.Parameter(
        name,
        getattr(openapi, location_attr),
        description=description,
        required=required,
        type=getattr(openapi, type)
    )