Try this
in your controller
$entity = $this->getEntity($id);
$context = new SerializationContext();
$context->setSerializeNull(true);
$serializer = $this->get('jms_serializer');
$response = new Response($serializer->serialize($entity, 'json', $context));
$response->headers->set('Content-Type', 'application/json');
return $response;
But the interaction with the fosrestbundle about configs is not known to me.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…