Add support for an unversioned 'versions' API call
This will eventually replace the unversioned 'capabilities' call. Client applications can use this versions call to find out what versions are available, if they support multiple versions. The capabilities of each version, and the format of the capabilities call, is then able to change between versions. If a client only supports one version they can jump straight to the versioned capabilities call. Additionally, supported versions are now a list of version identifiers, without any implications surrounding min/max values (e.g. guesswork for supported intermediate versions). Fixes #2162
This commit is contained in:
parent
5b4636d521
commit
2398614349
5 changed files with 60 additions and 1 deletions
15
app/controllers/api/versions_controller.rb
Normal file
15
app/controllers/api/versions_controller.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
module Api
|
||||
class VersionsController < ApiController
|
||||
authorize_resource :class => false
|
||||
|
||||
around_action :api_call_handle_error, :api_call_timeout
|
||||
|
||||
# Show the list of available API versions. This will replace the global
|
||||
# unversioned capabilities call in due course.
|
||||
# Currently we only support deploying one version at a time, but this will
|
||||
# hopefully change soon.
|
||||
def show
|
||||
@versions = [Settings.api_version]
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue