SAP/neonbee

[Feature]: Generate relative location header in the `ODataEndpoint`, when primary key is defined by Entity

Opened this issue · 0 comments

Is there an existing issue for this?

  • I have searched the existing issues

The Problem

Split from #326

As previously agreed, the behaviour of Create and Update should be as follows:

  • (1) When response contains the Location (via Response Hint)
    --> use Location as returned by EntityVerticle and set 201 (create) or 200 (update) HTTP status code
  • (2) When Response contains an Entity that defines the primary key completely
    --> generate relative location header in the ODataEndpoint, e.g. EntitySetName(PrimaryKey) (check if helper method is available in Olingo)
  • (3) Respond without an entity (e.g. empty future) or the returned entity does not contain the full primary key.
    --> for backward compatibility, continue as of now by not setting the location header and returning a 204 HTTP status code
  • (4) In future, to be able to use absolute URLs in Location header instead: provide helper method in NeonBee to generate absolute header based on currently RoutingContext and also add new „absoluteURLPrefix“ configuration (e.g. /backend as this is added by AppRouter not NeonBee)

(1) and (3) were already implemented as part of #326. This story is about implementing (2) and (4).

Desired Solution

No response

Alternative Solutions

No response

Additional Context

No response