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

JMSSerializer deserialize entity by id #776

Closed
ei-developpers-team opened this issue Oct 30, 2019 · 2 comments
Closed

JMSSerializer deserialize entity by id #776

ei-developpers-team opened this issue Oct 30, 2019 · 2 comments

Comments

@ei-developpers-team
Copy link

ei-developpers-team commented Oct 30, 2019

Hello,

any help plz;
i need to deserialize entity by id . () ManyToone.
Invalid data 1 (integer), expected

any idea?

@zoomtronic
Copy link

same issue, if you have any update on this..
the only thing that worked for me is to add merge before persist but its deprecated..

$serializer = SerializerBuilder::create()->build();
$block = $serializer->deserialize($encodedData, 'App\Entity\Block', 'json');
$block = $manager->merge($block);
// persist
$manager->persist($block);
$manager->flush();

@goetas
Copy link
Collaborator

goetas commented Jun 18, 2021

this has been documented in schmittjoh/serializer#1308

@goetas goetas closed this as completed Jun 18, 2021
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

3 participants