Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latest jms/serializer 3.3.0 breaks post requests #80

Open
IhorDerTaler opened this issue May 29, 2024 · 1 comment
Open

Latest jms/serializer 3.3.0 breaks post requests #80

IhorDerTaler opened this issue May 29, 2024 · 1 comment

Comments

@IhorDerTaler
Copy link

IhorDerTaler commented May 29, 2024

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.

@StanProg
Copy link

Related issue: #78

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants