lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

Fix validation errors on SampledValue #158

Closed lorenzodonini closed 1 year ago

lorenzodonini commented 1 year ago

Validation for SampledValue.Value in OCPP 2.0.1 was leading to errors for 0 values. This is not intended, since zero values are allowed.

Since go doesn't distinguish between zero and empty when parsing JSON into base types, this was fixed by removing the required validation tag from the field.

Closes #151, #157