src/Graviton/RestBundle/Listener/JsonRequestListener.php
public function onKernelRequest(RestEvent $event)
    {
        $request = $event->getRequest();

        if ($request->headers->has('Accept')) {

            $format = $request->getFormat($request->headers->get('Accept'));

            if (!empty($format)) {
                $request->setRequestFormat($format);
            }
        }
    }
public function onKernelRequest(RestEvent $event)
    {
        $request = $event->getRequest();

        if ($request->headers->has('Accept')) {

            $format = $request->getFormat($request->headers->get('Accept'));

            if (!empty($format)) {
                $request->setRequestFormat($format);
            }
        }
    }
public function onKernelRequest ( RestEvent $ event ) { $ request = $ event -> getRequest ( ) ; if ( $ request -> headers -> has ( 'Accept' ) ) { $ format = $ request -> getFormat ( $ request -> headers -> get ( 'Accept' ) ) ; if ( ! empty ( $ format ) ) { $ request -> setRequestFormat ( $ format ) ; } } }
Validate the json input to prevent errors in the following components

@param RestEvent $event Event

@return void|null
Validate the json input to prevent errors in the following components