X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/89d309ae02a0b47be4b201b78449afd4267effef..0e2f3e506566b1ceb54bd764d3f32c004e45f8b3:/services/api/app/controllers/application_controller.rb diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb index 9db8b44711..4625ef654c 100644 --- a/services/api/app/controllers/application_controller.rb +++ b/services/api/app/controllers/application_controller.rb @@ -305,7 +305,7 @@ class ApplicationController < ActionController::Base @objects = @objects.order(@orders.join ", ") if @orders.any? @objects = @objects.limit(@limit) @objects = @objects.offset(@offset) - @objects = @objects.distinct(@distinct) if not @distinct.nil? + @objects = @objects.distinct() if @distinct end # limit_database_read ensures @objects (which must be an @@ -427,7 +427,7 @@ class ApplicationController < ActionController::Base def append_info_to_payload(payload) super - payload[:request_id] = response.headers['X-Request-Id'] + payload[:request_id] = request.request_id payload[:client_ipaddr] = @remote_ip payload[:client_auth] = current_api_client_authorization.andand.uuid || nil end @@ -619,7 +619,11 @@ class ApplicationController < ActionController::Base def self._create_requires_parameters { - select: { type: 'array', required: false }, + select: { + type: 'array', + description: "Attributes of the new object to return in the response.", + required: false, + }, ensure_unique_name: { type: "boolean", description: "Adjust name to ensure uniqueness instead of returning an error on (owner_uuid, name) collision.", @@ -638,13 +642,21 @@ class ApplicationController < ActionController::Base def self._update_requires_parameters { - select: { type: 'array', required: false }, + select: { + type: 'array', + description: "Attributes of the updated object to return in the response.", + required: false, + }, } end def self._show_requires_parameters { - select: { type: 'array', required: false }, + select: { + type: 'array', + description: "Attributes of the object to return in the response.", + required: false, + }, } end @@ -653,8 +665,12 @@ class ApplicationController < ActionController::Base filters: { type: 'array', required: false }, where: { type: 'object', required: false }, order: { type: 'array', required: false }, - select: { type: 'array', required: false }, - distinct: { type: 'boolean', required: false }, + select: { + type: 'array', + description: "Attributes of each object to return in the response.", + required: false, + }, + distinct: { type: 'boolean', required: false, default: false }, limit: { type: 'integer', required: false, default: DEFAULT_LIMIT }, offset: { type: 'integer', required: false, default: 0 }, count: { type: 'string', required: false, default: 'exact' }, @@ -672,11 +688,6 @@ class ApplicationController < ActionController::Base } end - def client_accepts_plain_text_stream - (request.headers['Accept'].split(' ') & - ['text/plain', '*/*']).count > 0 - end - def render *opts if opts.first response = opts.first[:json]