You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
Let's suppose I have a customer container acting a bit like a map and I provide a hook to decode it. For the hook to convert a map to the appropriate container, it would need to be able to call back decode() for the values. It seems this is not possible with the current hooks. It would be nice to be able to expose decode() to the hooks for them to call it back to decode nested values.
With YAML's Unmarshaler interface, a possibility would be to decode the container as a map, then transform this map into the final container. I don't think that's something possible with mapstructure, as I don't have access to the original decoder configuration.
The text was updated successfully, but these errors were encountered:
+1 for this I just ran into this problem. If you implement a custom hook so you can do something like a discriminated union then ideally you'd like to be able to use the original decoder instance for the step.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hey!
Let's suppose I have a customer container acting a bit like a map and I provide a hook to decode it. For the hook to convert a map to the appropriate container, it would need to be able to call back
decode()
for the values. It seems this is not possible with the current hooks. It would be nice to be able to exposedecode()
to the hooks for them to call it back to decode nested values.With YAML's
Unmarshaler
interface, a possibility would be to decode the container as a map, then transform this map into the final container. I don't think that's something possible with mapstructure, as I don't have access to the original decoder configuration.The text was updated successfully, but these errors were encountered: