Closed rvindas-gap closed 10 years ago
Have you found any solution?
I ended up having the swagger_api entry as follows:
swagger_api :create do
summary "Creates a new Machine"
param :path, :client_id, :integer, :required, "Client ID"
param :body, :machine, :Machine, :required, "The Machine resource to create"
response :unauthorized
response :not_acceptable
end
where Machine is a complex type as follows:
swagger_model :Machine do
description "A Machine object."
property :name, :string, :optional, "Name"
...
property :disks, :array, :optional, "A list of disks", { "items" => { "$ref" => "Disk" } }
...
end
where Disk is another swagger_model with its own properties. Hope it helps
how to set name property under Model Machine an default value?
Hi, in a Ruby on Rails application, we have a swagger_model called Disk and the following is the parameter I am specifying in the corresponding swagger_api entry:
param :body, :disks, :Disk, :optional, "An array of disks"
How could I make this parameter an array in order to behave like this example: http://petstore.swagger.wordnik.com/#!/user/createUsersWithArrayInput ?
Thanks in advance