Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

Make validate_params work with the function's parametters instead of a dict #30

@Seluj78

Description

@Seluj78

Instead of having

@validate_params(
    {
        "name": str,
        "age": int,
        "is_student": bool,
        "courses": List[str],
        "grades": Dict[str, int],
    }
)
def example():

It would make more sense to have the decorator read the function arguments directly like so :

@validate_params
def example(name: str, age: int, is_student: bool, courses: List[str], grades: Dict[str, int]):

/!\ One attention point is to see how Flask interacts with the function and where it places it's variables when doing a function with some kind of slug (@app.route("/users/<user_id>"))

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions