When requesting JSON with one or zero array elements, the body parameters are no longer an array:
Case: POST { b => [123] }
Then: { b => 123}
Expected body parameters : { b => [123] }
Case: POST { b => [] }
Then: {}
Expected body parameters : { b => [] }
The following test code reproduces this problem. t/100_bugs/002_a_few_parameters_in_json_body.t
Solutions
Decode body parameters recursively.
Added json_parameters method for easier handling of JSON requests.
This pull request solves the following problems.
Problem
When requesting JSON with one or zero array elements, the body parameters are no longer an array:
The following test code reproduces this problem. t/100_bugs/002_a_few_parameters_in_json_body.t
Solutions
json_parameters
method for easier handling of JSON requests.