Skip to content

Passing is_array to grape swagger doesn't work as expected #50

Open
@code-bunny

Description

@code-bunny
desc "Transactions" do
  success ::Frontend::TransactionSerializer
  is_array true
  produces [ "application/vnd.api+json" ]
  consumes [ "application/vnd.api+json" ]
  headers Authorization: {
    description: "Authorization token for the current user(JWT).",
    required: true
  }
end

With the included desc block we are passing is_array so our FE team can generate their code from our swagger docs. However, this is not working as expected as it just wraps the whole document in an array instead of data: [] we get [data: {}]. Which is obviously undesired. Is there some other method we are missing that we'd need to call?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions