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

Allow @param(required=...) to take a callback #69

Open
Jaymon opened this issue Apr 7, 2017 · 1 comment
Open

Allow @param(required=...) to take a callback #69

Jaymon opened this issue Apr 7, 2017 · 1 comment

Comments

@Jaymon
Copy link
Owner

Jaymon commented Apr 7, 2017

add conditional to param, if the conditional is true then the param is required, otherwise False, this can be as easy as just making required=callback and that will be called at runtime to decide

Not sure if this is really needed with the new routing and version stuff in v2.0.0 but I had it in a comment and wanted to make sure it got saved in case I do find a use case

one of the reasons an approach like this might be useful is when using the route decorator because it might go a bit crazy if you have multiple routes and versions and the amount of methods could explode exponentially as you try and version multiple endpoints with multiple routes.

@Jaymon
Copy link
Owner Author

Jaymon commented Sep 11, 2018

another approach would be something like require_if="foo" where it would only be required if foo was present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant