Skip to content

Commit

Permalink
Merge pull request api-platform#3481 from adrientiburce/bug-3464
Browse files Browse the repository at this point in the history
Fix mispelling in hydra spec : writable to writeable
  • Loading branch information
teohhanhui authored Apr 5, 2020
2 parents 960f62f + e25afbb commit 3fe314b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion features/bootstrap/HydraContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public function assertPropertyIsNotReadable(string $propertyName, string $classN
*/
public function assertPropertyIsWritable(string $propertyName, string $className)
{
if (!$this->getPropertyInfo($propertyName, $className)->{'hydra:writable'}) {
if (!$this->getPropertyInfo($propertyName, $className)->{'hydra:writeable'}) {
throw new ExpectationFailedException(sprintf('Property "%s" of class "%s" is not writable', $propertyName, $className));
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/Hydra/Serializer/DocumentationNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ private function populateEntrypointProperties(string $resourceClass, ResourceMet
],
'hydra:title' => "The collection of $shortName resources",
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
];

if ($resourceMetadata->getCollectionOperationAttribute('GET', 'deprecation_reason', null, true)) {
Expand Down Expand Up @@ -416,7 +416,7 @@ private function getClasses(array $entrypointProperties, array $classes): array
'hydra:title' => 'propertyPath',
'hydra:description' => 'The property path of the violation',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
[
'@type' => 'hydra:SupportedProperty',
Expand All @@ -430,7 +430,7 @@ private function getClasses(array $entrypointProperties, array $classes): array
'hydra:title' => 'message',
'hydra:description' => 'The message associated with the violation',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
],
];
Expand All @@ -454,7 +454,7 @@ private function getClasses(array $entrypointProperties, array $classes): array
'hydra:title' => 'violations',
'hydra:description' => 'The violations',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
],
];
Expand Down Expand Up @@ -486,7 +486,7 @@ private function getProperty(PropertyMetadata $propertyMetadata, string $propert
'hydra:title' => $propertyName,
'hydra:required' => $propertyMetadata->isRequired(),
'hydra:readable' => $propertyMetadata->isReadable(),
'hydra:writable' => $propertyMetadata->isWritable() || $propertyMetadata->isInitializable(),
'hydra:writeable' => $propertyMetadata->isWritable() || $propertyMetadata->isInitializable(),
];

if (null !== $range = $this->getRange($propertyMetadata)) {
Expand Down
32 changes: 16 additions & 16 deletions tests/Hydra/Serializer/DocumentationNormalizerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ private function doTestNormalize(OperationMethodResolverInterface $operationMeth
'hydra:title' => 'name',
'hydra:required' => false,
'hydra:readable' => true,
'hydra:writable' => true,
'hydra:writeable' => true,
'hydra:description' => 'name',
],
[
Expand All @@ -179,7 +179,7 @@ private function doTestNormalize(OperationMethodResolverInterface $operationMeth
'hydra:title' => 'description',
'hydra:required' => false,
'hydra:readable' => true,
'hydra:writable' => true,
'hydra:writeable' => true,
'hydra:description' => 'description',
],
[
Expand All @@ -194,7 +194,7 @@ private function doTestNormalize(OperationMethodResolverInterface $operationMeth
'hydra:title' => 'name_converted',
'hydra:required' => false,
'hydra:readable' => true,
'hydra:writable' => true,
'hydra:writeable' => true,
'hydra:description' => 'name converted',
],
[
Expand All @@ -209,7 +209,7 @@ private function doTestNormalize(OperationMethodResolverInterface $operationMeth
'hydra:title' => 'relatedDummy',
'hydra:required' => false,
'hydra:readable' => true,
'hydra:writable' => true,
'hydra:writeable' => true,
'hydra:description' => 'This is a name.',
],
],
Expand Down Expand Up @@ -287,7 +287,7 @@ private function doTestNormalize(OperationMethodResolverInterface $operationMeth
],
'hydra:title' => 'The collection of dummy resources',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
],
'hydra:supportedOperation' => [
Expand All @@ -314,7 +314,7 @@ private function doTestNormalize(OperationMethodResolverInterface $operationMeth
'hydra:title' => 'propertyPath',
'hydra:description' => 'The property path of the violation',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
[
'@type' => 'hydra:SupportedProperty',
Expand All @@ -328,7 +328,7 @@ private function doTestNormalize(OperationMethodResolverInterface $operationMeth
'hydra:title' => 'message',
'hydra:description' => 'The message associated with the violation',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
],
],
Expand All @@ -350,7 +350,7 @@ private function doTestNormalize(OperationMethodResolverInterface $operationMeth
'hydra:title' => 'violations',
'hydra:description' => 'The violations',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
],
],
Expand Down Expand Up @@ -470,7 +470,7 @@ public function testNormalizeInputOutputClass()
'hydra:title' => 'a',
'hydra:required' => false,
'hydra:readable' => true,
'hydra:writable' => true,
'hydra:writeable' => true,
'hydra:description' => 'a',
],
[
Expand All @@ -485,7 +485,7 @@ public function testNormalizeInputOutputClass()
'hydra:title' => 'b',
'hydra:required' => false,
'hydra:readable' => true,
'hydra:writable' => true,
'hydra:writeable' => true,
'hydra:description' => 'b',
],
[
Expand All @@ -500,7 +500,7 @@ public function testNormalizeInputOutputClass()
'hydra:title' => 'c',
'hydra:required' => false,
'hydra:readable' => true,
'hydra:writable' => true,
'hydra:writeable' => true,
'hydra:description' => 'c',
],
[
Expand All @@ -515,7 +515,7 @@ public function testNormalizeInputOutputClass()
'hydra:title' => 'd',
'hydra:required' => false,
'hydra:readable' => true,
'hydra:writable' => true,
'hydra:writeable' => true,
'hydra:description' => 'd',
],
],
Expand Down Expand Up @@ -597,7 +597,7 @@ public function testNormalizeInputOutputClass()
],
'hydra:title' => 'The collection of dummy resources',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
],
'hydra:supportedOperation' => [
Expand All @@ -624,7 +624,7 @@ public function testNormalizeInputOutputClass()
'hydra:title' => 'propertyPath',
'hydra:description' => 'The property path of the violation',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
[
'@type' => 'hydra:SupportedProperty',
Expand All @@ -638,7 +638,7 @@ public function testNormalizeInputOutputClass()
'hydra:title' => 'message',
'hydra:description' => 'The message associated with the violation',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
],
],
Expand All @@ -660,7 +660,7 @@ public function testNormalizeInputOutputClass()
'hydra:title' => 'violations',
'hydra:description' => 'The violations',
'hydra:readable' => true,
'hydra:writable' => false,
'hydra:writeable' => false,
],
],
],
Expand Down

0 comments on commit 3fe314b

Please sign in to comment.