Open ohaibbq opened 4 months ago
I have the same issue.
Workaround meanwhile we do
func decodePayload(payload string, v any) error {
err := decodePayloadBigquery(payload, v)
if err != nil {
return decodePayloadFromEmulator(payload, &v)
}
return nil
}
func decodePayloadBigquery(payload string, v any) error {
err := json.Unmarshal([]byte(payload), &v)
if err != nil {
return fmt.Errorf("failed to unmarshal payload from bigquery: %w", err)
}
return nil
}
func decodePayloadFromEmulator(payload string, v any) error {
payload, err := strconv.Unquote(payload)
if err != nil {
return fmt.Errorf("failed to unquote payload: %w", err)
}
err = json.Unmarshal([]byte(payload), v)
if err != nil {
return fmt.Errorf("failed to unmarshal payload from emulator: %w", err)
}
return nil
}
@goccy mind reviewing this one for @renevall? Hope you're well!
Closes #286 Closes #334 Closes #144