Category : deserialization

I am trying to save by API an object given by the Front in React JS So I have this object testing in Insomnia: { "rate": 1.59, "correction":"2 ui nOVORAPID", "date": "2020-11-26", "time": "7:30"} I don’t understand why i have the error Failed to denormalize attribute "date" value for class "AppEntityBloodsugar": Expected argument of type ..

Read more

Let’s say I have a class class MyObj { /** @var int */ private $myProp; public function getMyProp(): int { return $this->myProp; } public function setMyProp(int $myProp): self { $this->myProp = $myProp; return $this; } } If I want to deserialize following $body = ‘{“myProp”: “4”}’; $myObj = $serializer->deserialize($body, MyObj::class, ‘json’); I obviously get an ..

Read more