protected function getWriterOptions(RequestInterface $request)
    {
        $options = new WriterOptions();
        $options->setContentType($request->getHeader('Accept'));
        $options->setFormat($request->getUri()->getParameter('format'));
        $options->setSupportedWriter($this->supportedWriter);
        $options->setWriterCallback(function(WriterInterface $writer) use ($request){
            if ($writer instanceof Writer\Jsonp) {
                if (!$writer->getCallbackName()) {
                    $writer->setCallbackName($request->getUri()->getParameter('callback'));
                }
            }
        });

        return $options;
    }