You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 20, 2019. It is now read-only.
Using symfony serializer leads to a serialization/deserialization issue:
I have complex Dto's with nested objects (also dto) which are serialized to a json (field: event_properties), but on deserialization - only top level obect is restored to a DTO:
Example:
<?php
namespace App\DTO;
use JMS\Serializer\Annotation as Serializer;
class OrderDto
{
/**
* @var string
* @Serializer\Type("string")
*/
public $orderId;
/**
* @var int
* @Serializer\Type("int")
*/
public $storeId;
/**
* @var string
* @Serializer\Type("string")
*/
public $shippingAddress;
/**
* @var string
* @Serializer\Type("string")
*/
public $comment;
/**
* @var OrderProductDto[]
* @Serializer\Type("array<App\DTO\OrderProductDto>")
*/
public $products = [];
}
class OrderProductDto
{
/**
* @var string
*
* @Serializer\Type("string")
*/
public $sku;
/**
* @var int
*
* @Serializer\Type("int")
*/
public $quantity;
}
on deserialisation, the $products is just a multidimensional array, instead of OrderProductDto[]
hope it's clear enough...
Great job on this package!
The text was updated successfully, but these errors were encountered:
Using symfony serializer leads to a serialization/deserialization issue:
I have complex Dto's with nested objects (also dto) which are serialized to a json (field: event_properties), but on deserialization - only top level obect is restored to a DTO:
Example:
on deserialisation, the
$products
is just a multidimensional array, instead of OrderProductDto[]hope it's clear enough...
Great job on this package!
The text was updated successfully, but these errors were encountered: