ADT_Frontend icon indicating copy to clipboard operation
ADT_Frontend copied to clipboard

consider versioning

Open larshp opened this issue 7 years ago • 2 comments

backend vs frontend

How to handle new/changed features in ADT_Frontend vs ADT_Backend

larshp avatar Jun 09 '18 08:06 larshp

This is handled by versioned request and response content types.

In ADT, the general rule is:

  • There is always one latest client version compatible with all supported backend versions.
  • A newer backend version can trigger a client update.

This is achieved by content negotiation:

  • The backend exposes content types it supports in the discovery document. This allows the client to see directly if it is able to produce request content with those types.
  • The backend checks the Content-Type: header of the request and responds with 415 UNSUPPORTED MEDIA TYPE, if it cannot consume it.
  • The backend checks the Accept: header, which the client sends and responds with 406 NOT ACCEPTABLE, if it cannot produce an appropriate response.

All these cases will trigger an OutDatedClientException on the client.

Example of versioned content types:

POST /sap/bc/adt/abapgit/externalrepoinfo
Content-Type: application/abapgit.adt.repo.info.ext.request.v1+xml
Accept: application/abapgit.adt.repo.info.ext.response.v2+xml, application/abapgit.adt.repo.info.ext.response.v1+xml;q=0.9

sratz avatar Aug 23 '18 08:08 sratz

What I would like to avoid is the following code, it raises complexity, the users can upgrade both backend and frontend without influencing the rest of the system, so it should be no problem helping the users to run the latest versions

image

larshp avatar Feb 25 '19 13:02 larshp