grape-swagger
grape-swagger copied to clipboard
Cannot post Array params
params do
...
optional :user_profiles, type: Array, default: [] do
requires :value, type: String, desc: "Value of the user profile"
end
end
Using the above gives me curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'user_profiles[value]=1' 'http://localhost:3000/api/v1/accounts/3/users', and it rejects with user_profiles invalid.
Can someone tell me what am I doing wrong here? Thx!
If I run this curl command it works: curl -X POST --header 'Content-Type: application/x-www-form-urlencoded' --header 'Accept: application/json' -d 'user_profiles[][value]=1' 'http://localhost:3000/api/v1/accounts/3/users'
This seems to be a bug. Should be the same in #617