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

Allowing only specified values of path parameter #203

Open
antimatter96 opened this issue Jun 30, 2017 · 1 comment · Fixed by gin-gonic/gin#2663
Open

Allowing only specified values of path parameter #203

antimatter96 opened this issue Jun 30, 2017 · 1 comment · Fixed by gin-gonic/gin#2663

Comments

@antimatter96
Copy link

antimatter96 commented Jun 30, 2017

I want routes like

/savings/all/:userid     

/savings/:service/:userid

The service is limited to say 7. Small enough to do something like /savings/{ec2 || emr || ops}:service but large that we cant write different handlers for all.
Is there any way to limit this type of usage ?

Since service are currently only 3 letter words, can we do something like

/savings/[a-z]{3}:service/:userid     

/savings/summary/:userid

Edit:
Currently I am doing

/savings/aws/all/:userid"
/savings/aws/:service/:userid"

But it gives existing wildcards

@meeDamian
Copy link

Quite disappointing it's not available in this otherwise perfect router :/.

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