sdk
sdk copied to clipboard
cannot unmarshal object into Go struct field Board.panels of type string
func (m *manager) DashboardPanels(ctx context.Context, uid string) ([]*grafanasdk.Panel, error) {
board, _, err := m.grafanaClient.GetDashboardByUID(ctx, uid)
if err != nil {
return nil, err
}
return board.Panels, nil
}
So strange, i have checked my dashboard json file, the panels field, it is an array not a string
@Yasumoto
Would you try #190? I was running into this error and think that it is fixed by the datasource change, even though the error is very confusing.
Go mod replace:
replace github.com/grafana-tools/sdk => github.com/csmarchbanks/sdk v0.0.0-20220120205302-870d00a83f4e
@csmarchbanks Thanks, it works!
https://github.com/grafana-tools/sdk/pull/190#issuecomment-1022983930 see my comment here. What do you think? :thinking: