endpoints icon indicating copy to clipboard operation
endpoints copied to clipboard

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

Open Jaymon opened this issue 8 years ago • 1 comments

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 avatar Apr 07 '17 01:04 Jaymon

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

Jaymon avatar Sep 11 '18 19:09 Jaymon