-
Notifications
You must be signed in to change notification settings - Fork 8.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Binding for URL Params #846
Comments
I'm wondering this too ? |
@miketonks that's an interesting feature, however the bind validator would need the fingerprint of the path, or just try to un marshall the |
We can get these value using |
Will it be implemented? I'm interest it too |
@javierprovecho do you happen to have any updates on this one? |
@Szasza can you describe the issue requirement? thanks! |
@thinkerou thank you for the ultra-quick response, it is much appreciated. Use case: having an URL path like Problem: Currently the above is not possible in a straightforward way, because:
One workaround I can think of from the top of my head is creating a new I hope the above helps. |
wip demo: #1612
Not un marshall it into struct, but traverse it and mapForm its element. |
@thinkerou thank you for the quick WIP demo, it works perfectly fine with valid values. I am unsure if the error handling is considered as finalised in the changeset, but if I set Thank you again. |
@Szasza you are welcome! |
@thinkerou I think there is a misunderstanding here, please allow me to clarify it. When I bind let's say the query parameters of a request, there are two tags that I use for the request struct's fields:
Is it possible to have the same pass-through for the I hope the above helps, please let me know if further clarification is needed, and thank you again. |
@thinkerou my pleasure, thank you for the quick implementation, it is much appreciated 😄 |
Why not support the type of params specified in URL? like
|
@axiaoxin IMO, that is too complex. |
Thanks for adding this feature, it looks great. If anyone is interested we solved the problem another way, which can be used on top of / alongside gin validation. |
#1612 merged! |
Thanks! This is great. Why not add |
When there will be a new release? This feature is useful and I don't want to fork to the latest commit. |
@dszakallas I will add it. thanks!
@halink0803 1.4 version on February 28, 2019, and publish release need to @javierprovecho help. |
@dszakallas #1694 add |
@thinkerou Thank you for quick response, I think we will fork latest commit by then. |
please there problem deal? I too like use it |
@cappuccino5 what's mean? |
please how bind uri to map |
Btw, should |
If I want a model to be bound to both |
Is there a way to validate URL params?
e.g.
How can I validate foo and bar?
It would be nice if c.Bind() method could fall back (query params, form params, url params) - maybe introducing a 'url' tag:
The text was updated successfully, but these errors were encountered: