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); $swgProperty = $this->annotationsReader->getPropertyAnnotation($reflectionProperty, SwgProperty::class);
if ($swgProperty instanceof SwgProperty) { if ($swgProperty instanceof SwgProperty) {
if ($swgProperty->type !== null) { if (null !== $swgProperty->type) {
$property->setType($swgProperty->type); $property->setType($swgProperty->type);
} }
if ($swgProperty->default !== UNDEFINED) { if (UNDEFINED !== $swgProperty->default) {
$property->setDefault($swgProperty->default); $property->setDefault($swgProperty->default);
} }
if ($swgProperty->enum !== null) { if (null !== $swgProperty->enum) {
$property->setEnum($swgProperty->enum); $property->setEnum($swgProperty->enum);
} }
if ($property instanceof Schema) { if ($property instanceof Schema) {
if ($swgProperty->description !== null) { if (null !== $swgProperty->description) {
$property->setDescription($swgProperty->description); $property->setDescription($swgProperty->description);
} }
if ($swgProperty->title !== null) { if (null !== $swgProperty->title) {
$property->setTitle($swgProperty->title); $property->setTitle($swgProperty->title);
} }
if ($swgProperty->example !== null) { if (null !== $swgProperty->example) {
$property->setExample($swgProperty->example); $property->setExample($swgProperty->example);
} }
if ($swgProperty->readOnly !== null) { if (null !== $swgProperty->readOnly) {
$property->setReadOnly($swgProperty->readOnly); $property->setReadOnly($swgProperty->readOnly);
} }
} }

View File

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

View File

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