I am faced with a problem that gives me this error:
A circular reference has been detected when serializing the object of class "App\\Entity\\User&q
In my case I've fixed injecting the serializer service instead of creating a new Serializer instance in the controller method.
use Symfony\Component\Serializer\SerializerInterface;
//...
public function createOrder(Request $request, SerializerInterface $serializer)
{
//...
$json = $serializer->serialize($order, 'json', ['groups' => ['normal']]);
//...
}