Closed pryankster closed 7 years ago
Looks like a bug, but it needs some time to investigate. Going to be fixed anyway.
Thanks for the report.
It's not a bug.
The first case with (ArrayRef[Str]
)
When you run a request with only one a
specified it is parsed by Plack::Request as a single value, not as an array.
With two a
specified it is parsed as an array.
The second case (Str
)
As I described above, it works with one s
as it is treated as a single value, and as an array in case of two s
and more.
To make it works you can use this command:
curl 'http://localhost:5000/items' -X GET -H 'Content-Type: application/json' -d '{"a":["a0","a1"],"s":"str"}'
Having a problem with parameters -- if I declare a parameter as ArrayRef[Str], the parser will only see the parameter if there is more than one of them. If I declare a paramter as Str, the parser will not see the parameter unless there is only one.
Queries:
Maybe I'm misunderstanding how these parameters should be described?
--pryankster