goecharger / go-eCharger-API-v2

New API specification for V3 and V4 go-eCharger
90 stars 21 forks source link

Request for local HTTP API V3. Make local HTTP API more conform to the best practices. #202

Open ai91 opened 5 months ago

ai91 commented 5 months ago

It's a great product, with rich features. Unfortunately some aspects don't really follow best practice. For example see https://github.com/goecharger/go-eCharger-API-v2/issues/201. Another issue is usage GET requests for all non-idempotent requests and non-safe requests.

Suggestion: make all write-methods as POST/PUT requests. More info: https://nordicapis.com/understanding-idempotency-and-safety-in-api-design/

0xFEEDC0DE64 commented 5 months ago

also wouldnt we break existing installations for all customers? breaking all existing software that is able to talk to our products, the only way I could see this change is by providing an on/off toggle for this new safety measures which is off by default

ai91 commented 5 months ago

also wouldnt we break existing installations for all customers? breaking all existing software that is able to talk to our products, the only way I could see this change is by providing an on/off toggle for this new safety measures which is off by default

Sure, it will break, and sure it must be off by default. Therefore I wrote "V3", keeping in mind an idea that for backwards compatibility there shall be V2 as a default with an option to switch to V3. Though not sure how much memory do you have for additional code, if it even possible to support so many features you already have.