15306: Fixes the bug.
authorLucas Di Pentima <ldipentima@veritasgenetics.com>
Tue, 4 Jun 2019 23:34:21 +0000 (20:34 -0300)
committerLucas Di Pentima <ldipentima@veritasgenetics.com>
Tue, 4 Jun 2019 23:34:21 +0000 (20:34 -0300)
The problem was coming from 2 sides:

1) The collections#show action didn't have the required parameters definitions.
2) The load_required_parameters callback was being called after the object
   lookup callback.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima@veritasgenetics.com>

services/api/app/controllers/application_controller.rb
services/api/app/controllers/arvados/v1/collections_controller.rb

index 89eabdcee2de14bd1d1ac1f38308a828e3c0f05c..40c7a8abf20508176d6ae7a12431ccb9f247f192 100644 (file)
@@ -42,9 +42,9 @@ class ApplicationController < ActionController::Base
   before_action :require_auth_scope, except: ERROR_ACTIONS
 
   before_action :catch_redirect_hint
+  before_action :load_required_parameters
   before_action(:find_object_by_uuid,
                 except: [:index, :create] + ERROR_ACTIONS)
-  before_action :load_required_parameters
   before_action :load_limit_offset_order_params, only: [:index, :contents]
   before_action :load_where_param, only: [:index, :contents]
   before_action :load_filters_param, only: [:index, :contents]
index 5d7a7ae266b82fa918a47312c6584d0897a6231c..7c7953ac9bb4d3daf4412d494e3e9619cfd7ad28 100644 (file)
@@ -21,6 +21,18 @@ class Arvados::V1::CollectionsController < ApplicationController
       })
   end
 
+  def self._show_requires_parameters
+    (super rescue {}).
+      merge({
+        include_trash: {
+          type: 'boolean', required: false, description: "Include collections whose is_trashed attribute is true."
+        },
+        include_old_versions: {
+          type: 'boolean', required: false, description: "Include past collection versions."
+        },
+      })
+  end
+
   def create
     if resource_attrs[:uuid] and (loc = Keep::Locator.parse(resource_attrs[:uuid]))
       resource_attrs[:portable_data_hash] = loc.to_s