private function documentOperations($operations)
    {
        if (null === $operations) {
            return null;
        }

        $result = array();

        foreach ($operations as $operation) {
            $statusCodes = array();
            foreach ($operation->getStatusCodes() as $code => $description) {
                $statusCodes[] = array(
                    'code' => $code,
                    'description' => $description
                );
            }

            $result[] = array(
                '@id' => '_:' . $operation->getName(),
                '@type' => $operation->getType() ?: 'hydra:Operation',
                'method' => $operation->getMethod(),
                'label' => ($operation->getTitle())
                    ?
                    : $operation->getDescription(),
                'description' => (null === $operation->getTitle())
                    ? null
                    : $operation->getDescription(),
                'expects' => $this->getTypeReferenceIri($operation->getExpects()),
                'returns' => $this->getTypeReferenceIri($operation->getReturns()),
                'statusCodes' => $statusCodes
            );
        }

        return $result;
    }