Skip to content

Commit b264181

Browse files
committed
Adding description of Sunset header and versioning
I realised we don't mention how to choose the version of the api. Also indicate that a Sunset header can be used to remove endpoints. This may be used to advertise an upcoming schema change that removes a class. Implementing the Sunset header for an endpoint is a TBD.
1 parent 9603b7b commit b264181

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

doc/rest.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,32 @@ Also if the user has exceeded the rate limit, this header is added:
129129

130130
**Retry-After**: The number of second to wait until 1 api call will succeed.
131131

132+
If the client has requested a deprecated API endpoint, the header:
133+
134+
**Sunset**: an http date after which the end point will not be available.
135+
136+
will be returned. It should be used as a hint that the REST endpoint
137+
will be going away. See https://tools.ietf.org/html/rfc8594 for
138+
details on this header and the sunset link type.
139+
140+
Versioning
141+
==========
142+
143+
Currently there is only one version of the API. Versions are simple
144+
integers. The current version is ``1``. Version selection is
145+
implemented in the server using one of three methods:
146+
147+
1. Explicit version param in accept header:
148+
``application/json; version=1``
149+
150+
2. Version suffix in vendor accept header:
151+
``application/vnd.json.test-v1+json``
152+
153+
3. Adding version specifier in query string: ``@apiver=1``
154+
155+
If an explicit version is not provided, the server default is used.
156+
The server default is reported by querying the ``/rest/`` endpoint as
157+
described above.
132158

133159
General Guidelines
134160
==================

0 commit comments

Comments
 (0)