OCPI.Net icon indicating copy to clipboard operation
OCPI.Net copied to clipboard

OCPI Backward compatibility: 2.1.1

Open YuriyDurov opened this issue 2 years ago • 4 comments

This issue will be used to track progress on achieving backward compatibility for OCPI version 2.1.1

Depends on #15

YuriyDurov avatar Sep 30 '23 09:09 YuriyDurov

Hi @YuriyDurov, How are you? Were you able to figure out a solution to support objects of different OCPI versions, when the object properties names haven't changed, but the property types did changed? For example, on https://github.com/BitzArt/OCPI.Net/blob/main/src/OCPI.Net.Contracts/Session/OcpiSession.cs, "TotalCost" property type changed between 2.1.1 and 2.2.1 versions, but the property name didn't, hence the object can't be used for OCPI 2.1.1 version, only for 2.2.1 version. Would be happy to hear your thoughts on this.

Regards, Lior

LiorBenAri avatar Nov 13 '23 19:11 LiorBenAri

Hello @LiorBenAri This can probably be solved by having two properties having the same json property name. So that either one can be used. Maybe a custom JsonConverter would also be required. Luckily, there shouldn't be too many cases like that.

YuriyDurov avatar Nov 13 '23 19:11 YuriyDurov

@YuriyDurov , @LiorBenAri , Hi, Just for your information: I had a go at this here: https://github.com/clouTrix/OCPI.Net (currently applied only on OcpiSession, OcpiLocation and OcpiCredentials objects).

Remarks, suggestions and improvements are always welcome ...

duke-bartholomew avatar Mar 19 '25 16:03 duke-bartholomew

@duke-bartholomew

Thanks for the heads up!

Any advancements will definitely be welcome here.

I am not able to dedicate much time to this project lately due to having to deal with other concerns.

YuriyDurov avatar Mar 19 '25 16:03 YuriyDurov