I have a Beam pipeline written in Go and I'd like to transform this input:
{"name": "Bob", "age": 32}
to a valid "object".
The go sdk has this function in the encoding package :
// UnmarshalJSON sets the state of this instance from the passed in JSON.
func (w *EncodedType) UnmarshalJSON(buf []byte) error {
var s string
if err := json.Unmarshal(buf, &s); err != nil {
return err
}
t, err := graphx.DecodeType(s)
if err != nil {
return err
}
w.T = t
return nil
}
But I don't understand how to use it as a step of my pipeline.