Using apipie-rails, I would like to describe the response of an array of strings.
# GET /api/v1/some_strings.json
["Foo", "Bar"]
I was thinking of describing the response like this:
api :GET "/api/v1/some_strings.json"
returns array_of: String, code: 200
def index
return json: ["Foo", "Bar"]
end
However, I'm getting the following runtime error:
RuntimeError:
No param_group or self-describing class named String
From the response-description documentation it looks like this is not supported by this dsl.
I was wondering whether there is another syntax to describe the desired response.
Or is returning an array of strings considered an anti-pattern and I should instead refactor the api structure itself?