Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include array responses in http_codes? #323

Open
penso opened this issue Dec 25, 2015 · 0 comments
Open

Include array responses in http_codes? #323

penso opened this issue Dec 25, 2015 · 0 comments

Comments

@penso
Copy link

penso commented Dec 25, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants