How to correctly call url_for and specify path parameters?

Solution
/students
/students/
@application.route("/students/", methods=["GET", "POST"])
def student_by_id(id):
    return {"student": id}

@application.route("/students")
def all_students():
    return {"students": "all"}
{{ student.id }}
@application.route(
    "/students/", 
    methods=["GET", "POST"], 
    endpoint="student_by_id",  # <---------
)
def students(id):
    return {"student": id}

@application.route("/students")
def students():
    return {"students": "all"}
{{ student.id }}
@application.route("/students")
@application.route("/students/", methods=["GET", "POST"])
def students(id=None):
    if id:
        return {"student": id}
    else:
        return {"students": "all"}
{{ student.id }}