I'm trying to post following JSON to the api. Following is the log from the Xcode console.
{
address = (
{
city = 1;
area = 1;
"building_name" = "building";
}
);
category = 1;
inspection = 0;
subCategory = (
12
);
}
So here address field is array of nested JSON objects. The problem is that address field isn't getting properly in server side. I think it thinks that sub fields including city, area, etc as individual dictionaries not a dictionary as a whole. Following is the log from the Laravel.
array (
'address' =>
array (
0 =>
array (
'city' => '1',
),
1 =>
array (
'area' => '1',
),
2 =>
array (
'building_name' => 'building',
),
),
'category' => '1',
'inspection' => '0',
'subCategory' =>
array (
0 => '12',
),
)
Basically I'm wondering if somehow Alamofire is trying to jsonify them twice but have no way to avoid it. I'm using Alamofire 4.7.2 and Gloss 2.0 and server side is based on Laravel.