Skip to content

Commit

Permalink
docs: clarify Api version method priority; payload @apiver
Browse files Browse the repository at this point in the history
Define how version is determined when multiple conflicting
methods are used. Add doc on use of @apiver in data payload for
PUT/POST (and maybe PATCH).

Now that this is defined, sent email to devel list to see if the
order should be changed. The url parameter is the lowest priorty
setting and will be ignored if any of the 3 higher priority
methods are used. However using the url setting is the easiest
for testing.
  • Loading branch information
rouilj committed Sep 18, 2023
1 parent 73db6d4 commit 275a30f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/rest.txt
Original file line number Diff line number Diff line change
Expand Up @@ -222,15 +222,21 @@ Versioning

Currently there is only one version of the API. Versions are simple
integers. The current version is ``1``. Version selection is
implemented in the server using one of three methods:
implemented in the server using one of four methods (in priority
order, highest first):

1. Explicit version param in accept header:
``application/json; version=1``

2. Version suffix in vendor accept header:
``application/vnd.json.test-v1+json``

3. Adding version specifier in query string: ``@apiver=1``
3. Adding ``@apiver: 1`` in the input data wrapper (for POST, PUT)

4. Adding version specifier in query string: ``@apiver=1`` (for GET).

The highest priority version method will be used if multiple
methods are used.

If an explicit version is not provided, the server default is used.
The server default is reported by querying the ``/rest/`` endpoint as
Expand Down

0 comments on commit 275a30f

Please sign in to comment.