mobilityhouse / ocpp

Python implementation of the Open Charge Point Protocol (OCPP).
MIT License
766 stars 298 forks source link

Bug Fixing in dataclass OCSPRequestDataType, attribute responder_url #551

Closed AlfredoNaef closed 8 months ago

AlfredoNaef commented 8 months ago

Hello,

When sending the message GetCertificateStatusRequest from the CP in OCPP201 the Payload fails to be validated. After some digging I found that when converting the Payload to camel case the field ocsp_request_data.responder_url is converted to ocspRequestData.responderUrl. However, when comparing it with the json schema the field is ocspRequestData.responderURL that then faills the validation and the message is never sent to the CS. I propose a quick fix, that consist in refactor the attribute responder_url into responder_URL in ocpp.ocpp.v201.datatypes for the dataclass OCSPRequestDataType. This solution will yield after conversion to camel case to responderURL, that match perfectly the json schema and will pass validation and hence send the message payload.

Jared-Newell-Mobility commented 8 months ago

Thanks for finding this; so I can understand clearly, I am wondering if you would be able to open a PR and include the unit tests that test for the behaviour change?

Jared-Newell-Mobility commented 8 months ago

It looks like there is an open PR for this https://github.com/mobilityhouse/ocpp/pull/336 - I'll put focus on it and so I will close this for now