Returns parameter names from the route.

def get_route_param_names(endpoint):
    """Returns parameter names from the route."""
    try:
        g = current_app.url_map.iter_rules(endpoint)
        return next(g).arguments
    except KeyError:
        return {}