You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Request change: passing the validated results to the route as parameters
I can make this change.
After the data have been validated by the decorator,
Now the developer has to validate them again inside the route.
What if I could pass them after they have clean and validated into the route.
They will be passed from the decorator to the route automatically.
And the user will not have to validate them again in the route.
So the code will look like this:
@app.route("/", methods=["POST"])@validate(body=BodyModel, query=QueryModel)defpost(requested):
#Requested is validatedbody=requested.body# This is body after validationquery=requested.query# This is query after validationname=body["name"]
nickname=body["nickname"]
age=query["age"]
This is all what the developer will have to write.
Cleaner code.
If God willed, I can make this change.
I request your permission to make this change
Thank you!
The text was updated successfully, but these errors were encountered:
I do not quite know what you meant by After the data have been validated by the decorator, Now the developer has to validate them again inside the route.
There are two ways of how to pass validated parameters into your route function.
when you use validate() decorator arguments then validated parameters are accessible via request variable
Hi Jirka!
That was exactly what I have meant.
If God willed, When I update the README.md, I will make sure that this is very clear.
Because this is what exactly what I came here to this package looking for as a developer.
And I believe that other developers need this feature too.
I will make very clear to them, so the package will be more usable.
I will try to do my best to represent the package in the README.md file.
Thank you so much.
Request change: passing the validated results to the route as parameters
I can make this change.
After the data have been validated by the decorator,
Now the developer has to validate them again inside the route.
What if I could pass them after they have clean and validated into the route.
They will be passed from the decorator to the route automatically.
And the user will not have to validate them again in the route.
So the code will look like this:
This is all what the developer will have to write.
Cleaner code.
If God willed, I can make this change.
I request your permission to make this change
Thank you!
The text was updated successfully, but these errors were encountered: