ruby-grape / grape-swagger

Add OAPI/swagger v2.0 compliant documentation to your grape API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cant define array params use param_type `body`

oslivan opened this issue · comments

Below is my code

desc do 
  summary 'Example'
end
params do
  optional :words, type: Array[String], desc: 'Some word' documentation: { param_type: 'body' }
end
post do
  # params[:words]
end

Due to only single array params, so swagger's doc didn't generate ref definition, reference to, I used Try it out, found curl's script without bring words, so my app raised. I just want to submit params like below

# expected
{
  words: ['A','B']
}

# actual
[
  'A',
  'B'
]

Have any other solution?

mmh, maybe you can write it as spec and open an PR …

@LeFnord Thanks for attention, I submitted a PR, please check it.

I find a PR about my problem, but I don't understand why it is.

sorry for latency …

commented on your above PR