A circular reference has been detected when serializing the object of class symfony 7
I am reaching out because I am encountering a circular reference issue. I am using version 7 of the symfony framework I have tried to implement several solutions, such as the attribute: #[MaxDepth(2)]. I have also set up DTOs to avoid this kind of problem, but despite everything, when I try to return JSON, I encounter this error: