Ability to indicate an array in response parameters.
I can't seem to find anywhere this is mentioned in the docs or tests. Is there any way to indicate that parameters are in an array of like objects?
For example, with the response
{
"users": [
{
"id": 1,
"username": "foo"
},
{
"id": 2,
"username": "bar"
}
]
}
would have response parameters like:
users[id]
users[username]
I would expect some way to output:
users[][id]
users[][username]
Am I missing something? Any thoughts?
I do not believe that this is possible right now. This is the response_field DSL? I can't think of a nice way around this, I will be happy to look at a PR if this is still an issue.
My first thought is to allow you to pass an extra option to the response_field call specifying exactly what the return scoping/field will be, :field => "users[][id] perhaps. This might be cumbersome quick though.
I know this is older but any updates around this? has anyone found a solution?
Has anyone found a solution? It is still actual 😓
I have found a solution: https://github.com/zipmark/rspec_api_documentation/issues/430