Error when trying to unmarshal json to frame using frame.UnmarshalJSON()

Hi when i’m trying to unmarshal a json to a frame and then send it to the actual panel, it founds an unexpected field that is the first key in the json message, is this a common problem? or i’m doing something wrong?

errorUnmash := frame.UnmarshalJSON(<-moduleMessage)
if errorUnmash != nil {
	log.DefaultLogger.Error("Error frame generation", "errorUnmash",errorUnmash)
}

=2022-04-15T11:09:26+0000 lvl=eror msg="Error frame generation" logger=plugins.backend pluginId=streaming-datasource-plugin errorUnmash="bind l1: unexpected field: _Class, error found in #10 byte of ...|{\"_Class\": \"Overhead|..., bigger context ...|{\"_Class\": \"Overhead_crane_status\", \"Yard_ID\": \"MA\", \"Line_I|..."

My guess would be that the JSON has an invalid format. Are you able to share an (anonymous) example of what you’re passing to the UnmarshalJSON method?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.