Skip to content

Object creation returns HTPP 200 instead of an HTTP 201 #65

@andacata

Description

@andacata

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.

OcpiStatus.SUCCESS.code -> if (ocpiResponseBody.data != null) HttpStatus.OK else HttpStatus.NOT_FOUND

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions