MeterValueRequest validation not checking that metervalues and sampled values have at least 1 element
Context: Had this issue while working with the library. Spotted through logs, that I sent
- MeterValuesRequests without any MeterValues
- MeterValues that did not contain any sampled Values
Looking at the OCPP 1.6 Standard Document it requires at least 1 Element for both MeterValues (P. 67 6. Messages -> 6.31 MeterValues) and SampledValues (P. 88 7.Types->7.33 MeterValue) to be a valid message.
Had this validation thrown these messages back in my face I would have spotted this error earlier.
Considering this is a potentially backwards breaking change I'm interested to know if this can be integrated to master or should rather be pushed against v2
Just in case: Pull request to master will be on it's way shortly
Hi @mmauksch
Thank you for the suggestion.
Regarding backward compatibility, my main concern is avoiding unnecessary contractual interface changes, which will cause compilation failures. I see this as a behavioral change that makes the library more compliant with the spec and thereby more compatible with other implementations (which is the goal of the library). Yes, it will cause frustrations for implementations that do not comply with the specs, but at least it will fail fast.
Because of that, I don't see a problem with introducing this into Master. Are there any objections?