Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MeterValueRequest validation not checking that metervalues and sampled values have at least 1 element #241

Open
mmauksch opened this issue Aug 16, 2023 · 1 comment

Comments

@mmauksch
Copy link
Contributor

Context: Had this issue while working with the library. Spotted through logs, that I sent

  1. MeterValuesRequests without any MeterValues
  2. 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

mmauksch added a commit to mmauksch/Java-OCA-OCPP that referenced this issue Aug 16, 2023
@TVolden
Copy link
Member

TVolden commented Aug 18, 2023

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?

TVolden added a commit that referenced this issue Mar 4, 2024
add stricter validation for Metervalues as described in  #241
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants