lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
277 stars 126 forks source link

fix FormationViolation to FormatViolation on CallError (OCPP 2.0.1 Specification, Table B06.FR.17) #202

Closed dwibudut closed 1 year ago

dwibudut commented 1 year ago

FormationViolation to FormatViolation base on OCPP 2.0.1 Specification Table B06.FR.17

dwibudut commented 1 year ago

Hello,

I just fix the GetInstalledCertificateIdsRequest and GetInstalledCertificateIdsResponse features based on json schema, I've also modified the test function.

Changes:

Thx

dwibudut commented 1 year ago

I added another fix on typeOfCertificate to certificateType according to json schema in CertificateSignedRequest feature

Thx

dwibudut commented 1 year ago

First of all thanks a lot for finding and fixing these implementation errors.

All commits except the first one LG2M (I left one minor comment).

Regarding the FormatViolation I cannot accept the change the way it is, because in v1.6 the error code is indeed called FormationViolation (for whatever reason this was changed in v2). I believe this might just be the only change between the two ocppj versions. Fixing one version would break the other. To not break anything we probably need to inject error codes from the top layer. I would suggest splitting this into 2 separate PRs.

For FormatViolation, currently I have no idea, whether to just add FormatViolation type and keep both (FormationViolation and FormatViolation) maybe, but the response CallError to client will still and always use FormationViolation on your top layer ParseMessage method

https://github.com/lorenzodonini/ocpp-go/blob/c34f6ad20983d34d7575d9fa05d85368ed0109e2/ocppj/ocppj.go#L373-L390

dwibudut commented 1 year ago

New issue https://github.com/lorenzodonini/ocpp-go/issues/210