Open
Description
Hi everyone,
I found the is_array
in the desc
parameter for an API endpoint to specify an array as response. But I didn't find how to specify that in the http_codes
part, something like:
desc "List All Delivery",
is_array: true,
entity: ::Delivery::Entity,
http_codes: [
[200, 'OK', ::Delivery::Entity],
[401, 'Unauthorized', API::Entities::Error],
[403, 'Forbidden', API::Entities::Error]
]
get do
present(paginate(::Delivery.all),
with: ::Delivery::Entity)
end
The generated Swagger documentation is my code makes you think the 200
response will give you a Hash but it won't, it's an array. Is there a way to do that?
Thanks.