protected function parseRequestBody(HttpRequest $httpRequest)
    {
        $requestBody = $httpRequest->getContent();
        if ($requestBody === null || $requestBody === '') {
            return [];
        }

        $mediaTypeConverter = $this->objectManager->get(MediaTypeConverterInterface::class);
        $propertyMappingConfiguration = new PropertyMappingConfiguration();
        $propertyMappingConfiguration->setTypeConverter($mediaTypeConverter);
        $propertyMappingConfiguration->setTypeConverterOption(MediaTypeConverterInterface::class, MediaTypeConverterInterface::CONFIGURATION_MEDIA_TYPE, $httpRequest->getHeader('Content-Type'));
        $arguments = $this->propertyMapper->convert($requestBody, 'array', $propertyMappingConfiguration);

        return $arguments;
    }
protected function parseRequestBody(HttpRequest $httpRequest)
    {
        $requestBody = $httpRequest->getContent();
        if ($requestBody === null || $requestBody === '') {
            return [];
        }

        $mediaTypeConverter = $this->objectManager->get(MediaTypeConverterInterface::class);
        $propertyMappingConfiguration = new PropertyMappingConfiguration();
        $propertyMappingConfiguration->setTypeConverter($mediaTypeConverter);
        $propertyMappingConfiguration->setTypeConverterOption(MediaTypeConverterInterface::class, MediaTypeConverterInterface::CONFIGURATION_MEDIA_TYPE, $httpRequest->getHeader('Content-Type'));
        $arguments = $this->propertyMapper->convert($requestBody, 'array', $propertyMappingConfiguration);

        return $arguments;
    }
protected function parseRequestBody ( HttpRequest $ httpRequest ) { $ requestBody = $ httpRequest -> getContent ( ) ; if ( $ requestBody === null || $ requestBody === '' ) { return [ ] ; } $ mediaTypeConverter = $ this -> objectManager -> get ( MediaTypeConverterInterface :: class ) ; $ propertyMappingConfiguration = new PropertyMappingConfiguration ( ) ; $ propertyMappingConfiguration -> setTypeConverter ( $ mediaTypeConverter ) ; $ propertyMappingConfiguration -> setTypeConverterOption ( MediaTypeConverterInterface :: class , MediaTypeConverterInterface :: CONFIGURATION_MEDIA_TYPE , $ httpRequest -> getHeader ( 'Content-Type' ) ) ; $ arguments = $ this -> propertyMapper -> convert ( $ requestBody , 'array' , $ propertyMappingConfiguration ) ; return $ arguments ; }
Parses the request body according to the media type.

@param HttpRequest $httpRequest
@return array
Parses the request body according to the media type .