Skip to content

Latest jms/serializer 3.3.0 breaks post requests #80

Description

@IhorDerTaler

With latest version of jms/serializer 3.3.0 the code

use BillbeeDe\BillbeeAPI\Client;
use BillbeeDe\BillbeeAPI\Model\Order;

$user = 'Your Billbee username';
$apiPassword = 'Your Billbee API Password';
$apiKey = 'Your Billbee API Key';
 
$client = new Client($user, $apiPassword, $apiKey);

$orderObject = new Order();
$orderObject->setCreatedAt(new \DateTime());
$billbeeOrder = $client->orders()->createOrder($orderObject, 123456789);

will result in error:

"Client error: `POST https://api.billbee.io/api/v1/orders?shopId=123456789` resulted in a `400 Bad Request` response:
{"Message":"The request is invalid.","ModelState":{"orderData":["Required property 'CreatedAt' not found in JSON. Path ' (truncated...)
"

Because latest version of jms/serializer sends json data as 'create_at' instead of 'CreatedAt'.

Temporary fix: downgrading to previous version of jms/serializer 3.29.1 seams to fix this particular case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions