mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 23:59:26 +03:00
Merge fixes
This commit is contained in:
commit
b5fb133533
@ -36,11 +36,8 @@ class PhpdocPropertyAnnotationReader
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the Swagger information with information from the DocBlock comment.
|
* Update the Swagger information with information from the DocBlock comment.
|
||||||
*
|
|
||||||
* @param \ReflectionProperty $reflectionProperty
|
|
||||||
* @param Items|Schema $property
|
|
||||||
*/
|
*/
|
||||||
public function updateWithPhpdoc(\ReflectionProperty $reflectionProperty, $property)
|
public function updateWithPhpdoc(\ReflectionProperty $reflectionProperty, Schema $property)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$docBlock = $this->docBlockFactory->create($reflectionProperty);
|
$docBlock = $this->docBlockFactory->create($reflectionProperty);
|
||||||
|
@ -29,14 +29,12 @@ class SwaggerPropertyAnnotationReader
|
|||||||
$this->annotationsReader = $annotationsReader;
|
$this->annotationsReader = $annotationsReader;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function updateWithSwaggerPropertyAnnotation(\ReflectionProperty $reflectionProperty, Schema $property)
|
||||||
* @param \ReflectionProperty $reflectionProperty
|
|
||||||
* @param Items|Schema $property
|
|
||||||
*/
|
|
||||||
public function updateWithSwaggerPropertyAnnotation(\ReflectionProperty $reflectionProperty, $property)
|
|
||||||
{
|
{
|
||||||
$swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class);
|
if (!$swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class)) {
|
||||||
if ($swgProperty instanceof SwgProperty) {
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (null !== $swgProperty->type) {
|
if (null !== $swgProperty->type) {
|
||||||
$property->setType($swgProperty->type);
|
$property->setType($swgProperty->type);
|
||||||
}
|
}
|
||||||
@ -46,7 +44,7 @@ class SwaggerPropertyAnnotationReader
|
|||||||
if (null !== $swgProperty->enum) {
|
if (null !== $swgProperty->enum) {
|
||||||
$property->setEnum($swgProperty->enum);
|
$property->setEnum($swgProperty->enum);
|
||||||
}
|
}
|
||||||
if ($property instanceof Schema) {
|
|
||||||
if (null !== $swgProperty->description) {
|
if (null !== $swgProperty->description) {
|
||||||
$property->setDescription($swgProperty->description);
|
$property->setDescription($swgProperty->description);
|
||||||
}
|
}
|
||||||
@ -61,5 +59,3 @@ class SwaggerPropertyAnnotationReader
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user