gin
gin copied to clipboard
TextUnmarshaler support for binding
- Adds encoding.TextUnmarshaler checking to support unmarshaling custom non-struct types.
- Adds binding.BindUnmarshaler to support unmarshaling custom structs (from the suggestion in #2673)
As of this PR you can support any kind of custom type without breaking support for time.Time and other structs that might implement TextUnmarshaler
Closes #2673 Closes #2631
@kszafran I think I've addressed all your feedback. Mind taking another look?
@thinkerou when you have a chance, could you review/merge/tag another maintainer?
Looks like an essential feature to have. @ssoroka Could you squash your commits as requested per CONTRIBUTING.md? @thinkerou @appleboy Could you check out this when you have time?
@amahiwa-jp I've squashed the commits into a single commit
ETA for this?
Updates?
Any update on when it can be merged?
Is there anything I can contribute to help get this merged?
To make it work with arrays []uuid.UUID
we might add to func setWithProperType
:
case reflect.Array:
if a, e := trySetCustom(val, value); a || e != nil {
return e
}
return errUnknownType
Any update on this?
Any update?
What are the perf changes for this update?
How much does it slow down binding for other things?
@appleboy @thinkerou @javierprovecho Any update on this?
Again, What is the perf change of this?
Have you done the work to assure it does not slow other things down?
I don't see any performance impact to this. I've been using this in production for a year and a half at this point. Maybe someone could pick it up, update it, and merge it?
@ssoroka I don't know why I can't review the PR? Can you create a new PR?
@appleboy this is way off my radar (it's been 2 years and I've switched to huma). Feel free to take the change over and apply it in a new PR.
I'm happy to help out here if anything is needed. Just let me know.
Any update on this?
I can't handle the PR now (maybe no permission to review and trigger unit testing). Please move to New PR: https://github.com/gin-gonic/gin/pull/3933