Closed richardcrichardc closed 9 years ago
Aren't params bound to a variable for us already? I'm probably misunderstanding, so feel free to show an example. :+1:
I was thinking if you had a route like:
/things/:section/:id
You could define a type:
type Thing struct {
Section string `param:"section" binding:"required"`
Id int `param:"id" binding:"required"`
}
Then leverage Bind's data validation. Maybe this is silly and I am missing a more obvious way to validate params.
Ah, you're thinking of using it for validation. I had never thought about that, but I guess I like the idea. I'd be interested in seeing a pull request whenever you get around to it!
Was thinking it would be cool if binding could bind to martini params. If this is something you guys think would be cool I will try and find some time to hack it up.