Skip to content
This repository has been archived by the owner on Jun 6, 2018. It is now read-only.

Commit

Permalink
Merge pull request api-platform#1466 from greg0ire/swagger_for_proper…
Browse files Browse the repository at this point in the history
…ties

Include swagger context even when type is null
  • Loading branch information
dunglas authored Oct 31, 2017
2 parents 2f2c569 + 0e221ff commit 290b619
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Swagger/Serializer/DocumentationNormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ private function getDefinitionSchema(string $resourceClass, ResourceMetadata $re
*/
private function getPropertySchema(PropertyMetadata $propertyMetadata, \ArrayObject $definitions, array $serializerContext = null): \ArrayObject
{
$propertySchema = new \ArrayObject();
$propertySchema = new \ArrayObject($propertyMetadata->getAttributes()['swagger_context'] ?? []);

if (false === $propertyMetadata->isWritable()) {
$propertySchema['readOnly'] = true;
Expand All @@ -533,7 +533,7 @@ private function getPropertySchema(PropertyMetadata $propertyMetadata, \ArrayObj

$valueSchema = $this->getType($builtinType, $isCollection, $className, $propertyMetadata->isReadableLink(), $definitions, $serializerContext);

return new \ArrayObject((array) $propertySchema + $valueSchema + ($propertyMetadata->getAttributes()['swagger_context'] ?? []));
return new \ArrayObject((array) $propertySchema + $valueSchema);
}

/**
Expand Down

0 comments on commit 290b619

Please sign in to comment.