Skip to content
This repository has been archived by the owner on Sep 7, 2018. It is now read-only.

Regex for Routing #14

Open
1 task done
100Errors opened this issue May 1, 2018 · 3 comments
Open
1 task done

Regex for Routing #14

100Errors opened this issue May 1, 2018 · 3 comments

Comments

@100Errors
Copy link

100Errors commented May 1, 2018

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'];
@danieldaeschle
Copy link
Owner

'/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

@danieldaeschle
Copy link
Owner

Do you mean something like: \/api(\/v1)? to match /api/v1 and /api as example?

@100Errors
Copy link
Author

I mean both :)

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

No branches or pull requests

2 participants