Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate parameters by type annotations #17

Closed
pylover opened this issue Apr 28, 2017 · 2 comments
Closed

Validate parameters by type annotations #17

pylover opened this issue Apr 28, 2017 · 2 comments
Labels
enhancement new feature or request feature add some ability invalid this dosen't seem right
Projects
Milestone

Comments

@pylover
Copy link
Owner

pylover commented Apr 28, 2017

Nice idea!

@validate
def index(self, a: int, b: str, c: date = datetime.now):
    ...

This behaviour should be implemented inside the validation system, so the @validate decorator is mandatory to enable this feature.

@pylover pylover added enhancement new feature or request feature add some ability labels Apr 28, 2017
@pylover pylover added this to Back Log in nanohttp May 14, 2017
@pylover pylover modified the milestone: when-pigs-fly May 14, 2017
@pylover pylover modified the milestones: when-pigs-fly, v1.x Jun 26, 2018
@pylover
Copy link
Owner Author

pylover commented Aug 7, 2018

@shayan-7 please follow here.

@pylover pylover added the invalid this dosen't seem right label Aug 7, 2018
@pylover
Copy link
Owner Author

pylover commented Aug 7, 2018

Only works for the query string, because finding and sorting positional arguments is not a good idea for every request.

On the other hand, the query string values will be validated using the validate decorator.

@pylover pylover closed this as completed Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new feature or request feature add some ability invalid this dosen't seem right
Projects
No open projects
nanohttp
Back Log
Development

No branches or pull requests

1 participant