This commit is contained in:
Guilhem Niot 2017-12-18 21:07:44 +01:00
parent 4e443c43b1
commit f03e33f551
4 changed files with 11 additions and 11 deletions

View File

@ -37,26 +37,26 @@ class SwaggerPropertyAnnotationReader
{
$swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class);
if ($swgProperty instanceof SwgProperty) {
if ($swgProperty->type !== null) {
if (null !== $swgProperty->type) {
$property->setType($swgProperty->type);
}
if ($swgProperty->default !== UNDEFINED) {
if (UNDEFINED !== $swgProperty->default) {
$property->setDefault($swgProperty->default);
}
if ($swgProperty->enum !== null) {
if (null !== $swgProperty->enum) {
$property->setEnum($swgProperty->enum);
}
if ($property instanceof Schema) {
if ($swgProperty->description !== null) {
if (null !== $swgProperty->description) {
$property->setDescription($swgProperty->description);
}
if ($swgProperty->title !== null) {
if (null !== $swgProperty->title) {
$property->setTitle($swgProperty->title);
}
if ($swgProperty->example !== null) {
if (null !== $swgProperty->example) {
$property->setExample($swgProperty->example);
}
if ($swgProperty->readOnly !== null) {
if (null !== $swgProperty->readOnly) {
$property->setReadOnly($swgProperty->readOnly);
}
}

View File

@ -54,7 +54,7 @@ class User
/**
* @var float
* @SWG\Property(default = 0.0)
* @SWG\Property(default = 0.0)
*/
private $money;

View File

@ -156,7 +156,7 @@ class FunctionalTest extends WebTestCase
'money' => [
'type' => 'number',
'format' => 'float',
'default' => 0.0
'default' => 0.0,
],
'id' => [
'type' => 'integer',
@ -195,7 +195,7 @@ class FunctionalTest extends WebTestCase
],
'status' => [
'type' => 'string',
'enum' => ["disabled", "enabled"],
'enum' => ['disabled', 'enabled'],
],
],
],

View File

@ -55,7 +55,7 @@ class JMSFunctionalTest extends WebTestCase
],
'status' => [
'type' => 'string',
'enum' => ["disabled", "enabled"],
'enum' => ['disabled', 'enabled'],
],
],
], $this->getModel('JMSUser')->toArray());