3412: Clean API Collections controller trailing whitespace.
[arvados.git] / services / api / app / controllers / arvados / v1 / schema_controller.rb
index 48aa166acb2ad568c20b1164265fcb5017e3a1c9..4470291504b87b0ef436cc99c63a087dfad632f0 100644 (file)
@@ -20,7 +20,7 @@ class Arvados::V1::SchemaController < ApplicationController
         description: "The API to interact with Arvados.",
         documentationLink: "http://doc.arvados.org/api/index.html",
         protocol: "rest",
-        baseUrl: root_url + "/arvados/v1/",
+        baseUrl: root_url + "arvados/v1/",
         basePath: "/arvados/v1/",
         rootUrl: root_url,
         servicePath: "arvados/v1/",
@@ -73,7 +73,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|
@@ -231,6 +231,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: "boolean",
+                  description: "Return each distinct object",
+                  location: "query"
                 }
               },
               response: {
@@ -357,7 +367,8 @@ class Arvados::V1::SchemaController < ApplicationController
                   method[:parameters][k] = {}
                 end
                 if !method[:parameters][k][:default].nil?
-                  method[:parameters][k][:default] = 'string'
+                  # The JAVA SDK is sensitive to all values being strings
+                  method[:parameters][k][:default] = method[:parameters][k][:default].to_s
                 end
                 method[:parameters][k][:type] ||= 'string'
                 method[:parameters][k][:description] ||= ''