[ARVADOS] updated: b4a9aaa3d68129d6e948dde46cee63cd66597aba

git at public.curoverse.com git at public.curoverse.com
Thu May 1 14:54:59 EDT 2014


Summary of changes:
 .../api/app/controllers/application_controller.rb  |   12 +++++++++++-
 .../controllers/arvados/v1/schema_controller.rb    |   10 ++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)

       via  b4a9aaa3d68129d6e948dde46cee63cd66597aba (commit)
      from  fe78b629dc39298c5990a093e73b7c6231f387b0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit b4a9aaa3d68129d6e948dde46cee63cd66597aba
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu May 1 14:54:51 2014 -0400

    Added 'select' and 'distinct' parameters to discovery document.  Improved
    select parameter to parse strings as json.

diff --git a/services/api/app/controllers/application_controller.rb b/services/api/app/controllers/application_controller.rb
index 4eb0d8e..8501c86 100644
--- a/services/api/app/controllers/application_controller.rb
+++ b/services/api/app/controllers/application_controller.rb
@@ -260,7 +260,17 @@ class ApplicationController < ActionController::Base
       @orders = default_orders
     end
 
-    @select = params[:select] if params[:select].andand.is_a? Array
+    case params[:select]
+    when Array
+      @select = params[:select]
+    when String
+      begin
+        @select = Oj.load params[:select]
+        raise unless @select.is_a? Array
+      rescue
+        raise ArgumentError.new("Could not parse \"select\" param as an array")
+      end
+    end
 
     if params[:distinct].is_a? String
       @distinct = params[:distinct]
diff --git a/services/api/app/controllers/arvados/v1/schema_controller.rb b/services/api/app/controllers/arvados/v1/schema_controller.rb
index 625519e..56c14f1 100644
--- a/services/api/app/controllers/arvados/v1/schema_controller.rb
+++ b/services/api/app/controllers/arvados/v1/schema_controller.rb
@@ -225,6 +225,16 @@ class Arvados::V1::SchemaController < ApplicationController
                   type: "string",
                   description: "Order in which to return matching #{k.to_s.underscore.pluralize}.",
                   location: "query"
+                },
+                select: {
+                  type: "array",
+                  description: "Select which fields to return",
+                  location: "query"
+                },
+                distinct: {
+                  type: "string",
+                  description: "Return each distinct value exactly once for the specified column (may skip rows)",
+                  location: "query"
                 }
               },
               response: {

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list