Closed ghost closed 10 years ago
I'm having the same question.
This works for me, maybe it works for you. Check this out: https://github.com/richhollis/swagger-docs/issues/71
@yo-mash Did #71 resolve the issue for you?
sort of, In that case I think if you want to specify an array you need to be able to set the 'type' : 'array' and 'items' : 'ModelName' which I don't think can be done with the gem currently.
If I understood you well, check if this won't help you. :)
For example, for an index action I have this:
swagger_api :show do
type 'index_response'
end
swagger_model :index_response do
property :foos, :array, :required, "List of foos", { "items" => { "$ref" => "foo_index_item" } }
end
swagger_model :foo_index_item do
(...)
id (...)
name(...)
(...)
end
For a show action:
swagger_api :show do
param :path, 'id', :integer, :required, 'id'
type :foo_show_item
end
swagger_model :foo_show_item do
(...)
id (...)
name (...)
bar (...)
(...)
end
That works, Thanks!
Is there a way to define references?
https://github.com/wordnik/swagger-spec/blob/master/versions/1.2.md#433-data-type-fields