Closed
Description
version 1.3.2
API definition
params do
requires :id, type: Integer
optional :hash, type: Hash do
requires :name, type: String
end
requires :arr_parent, type: Hash do
requires :id, type: Integer
optional :arr, type: Array do
requires :k, type: String
requires :v, type: String
end
end
end
end
put '/results' do
declared_params = declared(params)
end
Request body:
{
"id": 1,
"arr_parent": {
"id": 1
}
}
real declared_params:
{
"id": 1,
"hash": {
"name": nil
},
"arr_parent": {
"id": 1,
"arr": {
"k": nil,
"v": nil
}
}
}
expected declared_params:
{
"id": 1,
"hash": {} or nil
"arr_parent": {
"id": 1,
"arr": []
}
}
is this bugs? or specification?
declared_param_is_array? method in lib/grape/dsl/inside_route.rb doesn't seem to work correctly for nested array.
maybe relate #1847