Regex for Routing
100Errors opened this issue · comments
100Errors commented
Submitting...
- Feature
Hey there,
what about regular expressions for routing? or something like:
@swapy.on('/api/v1/{param_id}/new')
def newParam(args):
return args['param_id']
or optional parameters:
@swapy.on('/api/v1/[/{param_id}]')
def optionalParam(args):
return args['param_id'];
Daniel Däschle commented
'/api/v1/{param_id}/new'
isn't regex. it's just url parameters. yes it is supported.
optional parameters can be achieved by using two routes.
@swapy.on('/api/v1')
@swapy.on('/api/v1/:id')
def something(): pass
Daniel Däschle commented
Do you mean something like: \/api(\/v1)?
to match /api/v1
and /api
as example?
100Errors commented
I mean both :)