Commit 3d5dfa25 authored by Samir Noir's avatar Samir Noir 🧀
Browse files

Fix OpenApi parameters schema description

The :type, :default and :pattern were not inside schema block
parent 25c450f9
......@@ -68,7 +68,9 @@ class ApidocsController < ActionController::Base
key :in, :query
key :description, 'Fetch a full view of reference-repository, under this path.'
key :required, false
key :type, :boolean
schema do
key :type, :boolean
end
end
parameter :version do
......@@ -78,7 +80,9 @@ class ApidocsController < ActionController::Base
"This allow to get a specific version of the requested resource, to go back "\
"in time."
key :required, false
key :type, :string
schema do
key :type, :string
end
end
parameter :timestamp do
......@@ -87,7 +91,9 @@ class ApidocsController < ActionController::Base
key :description, 'Fetch the version of reference-repository for the ' \
'specified UNIX timestamp.'
key :required, false
key :type, :integer
schema do
key :type, :integer
end
end
parameter :date do
......@@ -96,8 +102,10 @@ class ApidocsController < ActionController::Base
key :description, 'Fetch the version of reference-repository for the ' \
'specified date (ISO_8601 format).'
key :required, false
key :type, :string
key :format, :'date-time'
schema do
key :type, :string
key :format, :'date-time'
end
end
parameter :branch do
......@@ -106,8 +114,10 @@ class ApidocsController < ActionController::Base
key :description, "Use a specific branch of reference-repository, for example "\
"the 'testing' branch contains the resources that are not yet in production."
key :required, false
key :type, :string
key :default, 'master'
schema do
key :type, :string
key :default, 'master'
end
end
parameter :limit do
......@@ -115,7 +125,9 @@ class ApidocsController < ActionController::Base
key :in, :query
key :description, 'Limit the number of items to return.'
key :required, false
key :type, :integer
schema do
key :type, :integer
end
end
parameter :offset do
......@@ -123,7 +135,9 @@ class ApidocsController < ActionController::Base
key :in, :query
key :description, 'Paginate through the collection with multiple requests.'
key :required, false
key :type, :integer
schema do
key :type, :integer
end
end
parameter :clusterId do
......@@ -131,7 +145,9 @@ class ApidocsController < ActionController::Base
key :in, :path
key :description, 'ID of cluster to fetch.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
parameter :siteId do
......@@ -139,7 +155,9 @@ class ApidocsController < ActionController::Base
key :in, :path
key :description, 'ID of site to fetch.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
parameter :nodeId do
......@@ -147,7 +165,9 @@ class ApidocsController < ActionController::Base
key :in, :path
key :description, 'ID of node to fetch.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
parameter :pduId do
......@@ -155,7 +175,9 @@ class ApidocsController < ActionController::Base
key :in, :path
key :description, 'ID of pdu to fetch.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
parameter :serverId do
......@@ -163,7 +185,9 @@ class ApidocsController < ActionController::Base
key :in, :path
key :description, 'ID of server to fetch.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
parameter :networkEquipmentId do
......@@ -171,7 +195,9 @@ class ApidocsController < ActionController::Base
key :in, :path
key :description, 'ID of network equipment to fetch.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
parameter :statusDisks do
......@@ -180,9 +206,11 @@ class ApidocsController < ActionController::Base
key :description, "Enable or disable status of disks in response. "\
"Should be 'yes' or 'no'."
key :required, false
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'yes'
schema do
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'yes'
end
end
parameter :statusNodes do
......@@ -191,9 +219,11 @@ class ApidocsController < ActionController::Base
key :description, "Enable or disable status of nodes in response. "\
"Should be 'yes' or 'no'."
key :required, false
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'yes'
schema do
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'yes'
end
end
parameter :statusVlans do
......@@ -202,9 +232,11 @@ class ApidocsController < ActionController::Base
key :description, "Enable or disable status of vlans in response. "\
"Should be 'yes' or 'no'."
key :required, false
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'yes'
schema do
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'yes'
end
end
parameter :statusSubnets do
......@@ -213,9 +245,11 @@ class ApidocsController < ActionController::Base
key :description, "Enable or disable status of subnets in response. "\
"Should be 'yes' or 'no'."
key :required, false
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'yes'
schema do
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'yes'
end
end
schema :BaseApiCollection do
......
......@@ -111,7 +111,9 @@ class VersionsController < ApplicationController
key :in, :path
key :description, 'ID of version to fetch, as a Git commit hash.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
end
......
......@@ -50,7 +50,9 @@ module Grid5000
key :in, :path
key :description, 'ID of deployment to fetch.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
parameter :deployReverse do
......@@ -59,7 +61,9 @@ module Grid5000
key :description, 'Return deployment collection in reversed creation order. '\
'By default, deployments are listed in descending creation date order.'
key :required, false
key :type, :boolean
schema do
key :type, :boolean
end
end
parameter :deployStatus do
......@@ -68,7 +72,9 @@ module Grid5000
key :description, 'Filter the deployment collection with a specific deployment '\
'state (waiting, processing, canceled, terminated, error).'
key :required, false
key :type, :string
schema do
key :type, :string
end
end
parameter :deployUser do
......@@ -77,7 +83,9 @@ module Grid5000
key :description, 'Filter the deployment collection with a specific deployment '\
' owner.'
key :required, false
key :type, :string
schema do
key :type, :string
end
end
schema :DeploymentCollection do
......
......@@ -41,7 +41,9 @@ module Grid5000
key :in, :path
key :description, 'ID of job to fetch.'
key :required, true
key :type, :string
schema do
key :type, :string
end
end
parameter :jobQueue do
......@@ -49,7 +51,9 @@ module Grid5000
key :in, :path
key :description, 'Filter jobs with a specific queue.'
key :required, false
key :type, :string
schema do
key :type, :string
end
end
parameter :jobProject do
......@@ -57,7 +61,9 @@ module Grid5000
key :in, :query
key :description, 'Filter jobs with a specific project name.'
key :required, false
key :type, :string
schema do
key :type, :string
end
end
parameter :jobUser do
......@@ -65,7 +71,9 @@ module Grid5000
key :in, :query
key :description, 'Filter jobs with a specific owner.'
key :required, false
key :type, :string
schema do
key :type, :string
end
end
parameter :jobName do
......@@ -73,7 +81,9 @@ module Grid5000
key :in, :query
key :description, 'Filter jobs with a specific name.'
key :required, false
key :type, :string
schema do
key :type, :string
end
end
parameter :jobState do
......@@ -82,7 +92,9 @@ module Grid5000
key :description, 'Filter jobs by state (waiting, launching, running, '\
'hold, error, terminated), as a comma-separated list.'
key :required, false
key :type, :string
schema do
key :type, :string
end
end
parameter :jobResources do
......@@ -91,9 +103,11 @@ module Grid5000
key :description, "Get more details (assigned_nodes and resources_by_types) "\
"for each job in the list. Should be 'yes' or 'no'."
key :required, false
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'no'
schema do
key :type, :string
key :pattern, '^(no|yes)$'
key :default, 'no'
end
end
schema :OarEvent do
......
......@@ -30,7 +30,9 @@ module Grid5000
key :in, :path
key :description, 'ID of vlan to fetch.'
key :required, true
key :type, :integer
schema do
key :type, :integer
end
end
parameter :userId do
......@@ -38,7 +40,9 @@ module Grid5000
key :in, :path
key :description, "ID of Grid'5000 user."
key :required, true
key :type, :string
schema do
key :type, :string
end
end
schema :Vlan do
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment