supportsDecoding() public method

Checks whether the serializer can decode from given format
public supportsDecoding ( string $format ) : boolean
$format string format name
return boolean
 /**
  * Decodes the request body
  *
  * @param Request $request The request
  *
  * @return void
  */
 protected function decodeBody(Request $request)
 {
     if (in_array($request->getMethod(), ['POST', 'PUT', 'PATCH', 'DELETE'])) {
         $contentType = $request->headers->get('Content-Type', '');
         $format = $this->formatNegotiator->getFormat($contentType);
         if (!$this->contentDecoder->supportsDecoding($format)) {
             return;
         }
         $content = $request->getContent();
         if (!empty($content)) {
             try {
                 $data = $this->contentDecoder->decode($content, $format);
             } catch (Exception $exception) {
                 $data = null;
             }
             if (is_array($data)) {
                 $request->request->replace($data);
             } else {
                 $message = sprintf('Invalid %s message received', $format);
                 throw new BadRequestHttpException($message);
             }
         }
     }
 }