Closed vamshiaruru32 closed 1 year ago
Hi @vamshiaruru32, sorry the new code brought in some breacking changes of the APIs.
Quick answer here:
func decodeStringPointer(value string) (any, error) {
return &value, nil
}
func init() {
httpin.RegisterValueTypeDecoder[*string](httpin.DecoderFunc[string](decodeStringPointer))
}
But for the latest version v0.14.0, you don't need to create pointer type decoders, it's already been registered automatically by httpin.
Thank you! I have upgraded to 0.14.0 and removed the register functions, and everything is working. I'll be closing this issue now :)
This should mandate a MAJOR version number change per semver. 😢 You should also update the documentation here: https://ggicci.github.io/httpin/directives/decoder
Hello everyone, I am currently on httpin 0.11.0 and I use
httpin.RegisterTypeDecoder
to register types for pointer fields (I do not want to use the new patch fields because of personal preferences). But looks like the method has been removed in 0.12.0 as part of refactor. What is the new way of registering a new type decoder?Previous code:
What's the new code? Thanks in advance!