Open
Description
Hi. I'm trying to send a request as follows:
rawResp, err := st.Send(&cpreq.StopTransaction{
TransactionId: ocppVars.TransactionId[id],
MeterStop: int(ocppVars.Connectors[id].Consumed),
Timestamp: time.Now(),
Reason: "Remote",
})
And StopTransaction struct has 'omitempty' json parameters on each non-required field but when I send the request the server(which is not based on the same library) gets this:
"StopTransaction",{"idTag":"","meterStop":13740,"reason":"Remote","timestamp":"2020-12-03T20:41:33+03:00","transactionData":null,"transactionId":1}
It complains about transactionData and replying with the following error message:
Error: Invalid value "null" for field transactionData
As you can see all the other optional fields are also included in the query.
Any idea how do I send the request omitting optional values ?
Metadata
Metadata
Assignees
Labels
No labels