Permalink
Browse files

Use the new singular property names of Hydra

  • Loading branch information...
lanthaler committed Jul 7, 2014
1 parent b409e88 commit 158a4dee5e45b7eea5f27c86f1d1ad821d0772a9
Showing with 10 additions and 10 deletions.
  1. +1 −1 Entity/Collection.php
  2. +9 −9 HydraApi.php
@@ -23,7 +23,7 @@ class Collection
/**
* @var array The members of this collection.
*
* @Hydra\Expose(iri="http://www.w3.org/ns/hydra/core#members")
* @Hydra\Expose(iri="http://www.w3.org/ns/hydra/core#member")
*/
private $members;
@@ -207,9 +207,9 @@ public function getDocumentation()
'property' => 'hydra:property',
'readonly' => 'hydra:readonly',
'writeonly' => 'hydra:writeonly',
'supportedClasses' => 'hydra:supportedClasses',
'supportedProperties' => 'hydra:supportedProperties',
'supportedOperations' => 'hydra:supportedOperations',
'supportedClass' => 'hydra:supportedClass',
'supportedProperty' => 'hydra:supportedProperty',
'supportedOperation' => 'hydra:supportedOperation',
'method' => 'hydra:method',
'expects' => array('@id' => 'hydra:expects', '@type' => '@id'),
'returns' => array('@id' => 'hydra:returns', '@type' => '@id'),
@@ -224,22 +224,22 @@ public function getDocumentation()
),
'@id' => $this->vocabUrl,
'@type' => 'ApiDocumentation',
'supportedClasses' => array()
'supportedClass' => array()
);
foreach ($metadata as $class) {
if ($class->isExternalReference()) {
$docu['supportedClasses'][] = array(
$docu['supportedClass'][] = array(
'@id' => $class->getIri()
);
} else {
$docu['supportedClasses'][] = array(
$docu['supportedClass'][] = array(
'@id' => 'vocab:' . $class->getIri(),
'@type' => 'hydra:Class',
'label' => $class->getTitle(),
'description' => $class->getDescription(),
'supportedOperations' => $this->documentOperations($class->getOperations()),
'supportedProperties' => $this->documentClassProperties($class),
'supportedOperation' => $this->documentOperations($class->getOperations()),
'supportedProperty' => $this->documentClassProperties($class),
);
}
@@ -315,7 +315,7 @@ private function documentClassProperties(\ML\HydraBundle\Mapping\ClassMetadata $
'description' => $property->getDescription(),
'domain' => $propertyDomain,
'range' => $this->getTypeReferenceIri($property->getType()),
'supportedOperations' => $this->documentOperations($property->getOperations())
'supportedOperation' => $this->documentOperations($property->getOperations())
),
'required' => $property->getRequired(),
'readonly' => $property->isReadOnly(),

0 comments on commit 158a4de

Please sign in to comment.