X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/d6e4e65cf3aae701c3e02a814329757e869a1d6d..c7515954731c6b7c0d8fb241ec4316a5e6d62d0c:/services/api/app/controllers/arvados/v1/schema_controller.rb diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb index 2c55b15068..443c6503c6 100644 --- a/services/api/app/controllers/arvados/v1/schema_controller.rb +++ b/services/api/app/controllers/arvados/v1/schema_controller.rb @@ -37,6 +37,7 @@ class Arvados::V1::SchemaController < ApplicationController defaultTrashLifetime: Rails.application.config.default_trash_lifetime, blobSignatureTtl: Rails.application.config.blob_signature_ttl, maxRequestSize: Rails.application.config.max_request_size, + dockerImageFormats: Rails.application.config.docker_image_formats, parameters: { alt: { type: "string", @@ -85,7 +86,7 @@ class Arvados::V1::SchemaController < ApplicationController if Rails.application.config.websocket_address discovery[:websocketUrl] = Rails.application.config.websocket_address elsif ENV['ARVADOS_WEBSOCKETS'] - discovery[:websocketUrl] = (root_url.sub /^http/, 'ws') + "websocket" + discovery[:websocketUrl] = root_url.sub(/^http/, 'ws') + "websocket" end ActiveRecord::Base.descendants.reject(&:abstract_class?).each do |k| @@ -246,12 +247,18 @@ class Arvados::V1::SchemaController < ApplicationController }, select: { type: "array", - description: "Select which fields to return", + description: "Select which fields to return.", location: "query" }, distinct: { type: "boolean", - description: "Return each distinct object", + description: "Return each distinct object.", + location: "query" + }, + count: { + type: "string", + description: "Type of count to return in items_available ('none' or 'exact').", + default: "exact", location: "query" } }, @@ -377,21 +384,21 @@ class Arvados::V1::SchemaController < ApplicationController method = d_methods[action.to_sym] end if ctl_class.respond_to? "_#{action}_requires_parameters".to_sym - ctl_class.send("_#{action}_requires_parameters".to_sym).each do |k, v| + ctl_class.send("_#{action}_requires_parameters".to_sym).each do |l, v| if v.is_a? Hash - method[:parameters][k] = v + method[:parameters][l] = v else - method[:parameters][k] = {} + method[:parameters][l] = {} end - if !method[:parameters][k][:default].nil? + if !method[:parameters][l][:default].nil? # The JAVA SDK is sensitive to all values being strings - method[:parameters][k][:default] = method[:parameters][k][:default].to_s + method[:parameters][l][:default] = method[:parameters][l][:default].to_s end - method[:parameters][k][:type] ||= 'string' - method[:parameters][k][:description] ||= '' - method[:parameters][k][:location] = (route.segment_keys.include?(k) ? 'path' : 'query') - if method[:parameters][k][:required].nil? - method[:parameters][k][:required] = v != false + method[:parameters][l][:type] ||= 'string' + method[:parameters][l][:description] ||= '' + method[:parameters][l][:location] = (route.segment_keys.include?(l) ? 'path' : 'query') + if method[:parameters][l][:required].nil? + method[:parameters][l][:required] = v != false end end end