-
-
Notifications
You must be signed in to change notification settings - Fork 958
Closed
Labels
Description
API Platform version(s) affected: 4.0.14
Description
With standard_put: false, I expect that missing fields would not be reset to NULL. However, this is not true for Embeddables.
How to reproduce
#[ApiResource()]
#[ORM\Entity()
class DatasyncConnector {
#[ORM\Embedded(Embeddable::class)]
public ?Embeddable $embeddable = null;
}
#[ORM\Embeddable()]
class MicrosoftGraph
{
#[ORM\Column(type: 'guid', nullable: true)]
public string $clientId;
#[ORM\Column(nullable: true)]
public ?string $clientSecret = null;
}If you send payload
{"embeddable": {"client_id": "foo", "client_secret": "bar"}}And afterwards
{"embeddable": {"client_id": "foo"}}client_secret would be set to NULL. Expectation is that client_secret would preserve previous value (bar).
Possible Solution
Additional Context
I've not inspected if this is in general problem with any nested objects.