ocpi-toolkit icon indicating copy to clipboard operation
ocpi-toolkit copied to clipboard

Object creation returns HTPP 200 instead of an HTTP 201

Open andacata opened this issue 1 year ago • 2 comments

The OCPI documentation states that:

When the server receives a valid OCPI object it SHOULD respond with: • HTTP 200 - Ok when the object already existed and has successfully been updated. • HTTP 201 - Created when the object has been newly created in the server system.

But the HTTP code is generated based on the OCPI status, so it's difficult to know which HTTP status must be returned.

https://github.com/IZIVIA/ocpi-toolkit/blob/ed450b662b98739c307b895099a8b98a551bdf63/ocpi-toolkit-2.2.1/src/main/kotlin/com/izivia/ocpi/toolkit/common/OcpiResponseBody.kt#L124

andacata avatar Jan 16 '24 09:01 andacata