protected function getSerializationContext(array $functionConfig)
    {
        if (isset($functionConfig['jms_serialization_context'])) {
            $serializationContext = \JMS\Serializer\SerializationContext::create();

            if (isset($functionConfig['jms_serialization_context']['groups'])) {
                $serializationContext->setGroups($functionConfig['jms_serialization_context']['groups']);
            }

            if (isset($functionConfig['jms_serialization_context']['version'])) {
                $serializationContext->setVersion($functionConfig['jms_serialization_context']['version']);
            }

            if (isset($functionConfig['jms_serialization_context']['max_depth_checks'])) {
                $serializationContext->enableMaxDepthChecks($functionConfig['jms_serialization_context']['max_depth_checks']);
            }
        } else {
            $serializationContext = $this->serializationContext;
        }

        return $serializationContext;
    }