Use only JMS/GroupExclusion if groups are there

When no groups are given in the ApiDoc, there should be no GroupExclusion and the Entity should be parsed wihtout exclusions.

Otherwise only the "Default" group of the Entity would be parsed, which may not be used.

The ApiDoc should not enforce the Entity to be grouped with "Default", to generate a "full-view" of it.
This commit is contained in:
Julius Beckmann 2013-12-20 12:58:34 +01:00 committed by Julius Beckmann
parent 4b6efc6631
commit 0845377300
2 changed files with 11 additions and 1 deletions

View File

@ -98,7 +98,9 @@ class JmsMetadataParser implements ParserInterface
}
$exclusionStrategies = array();
$exclusionStrategies[] = new GroupsExclusionStrategy($groups);
if ($groups) {
$exclusionStrategies[] = new GroupsExclusionStrategy($groups);
}
$params = array();

View File

@ -169,6 +169,14 @@ class JmsMetadataParserTest extends \PHPUnit_Framework_TestCase
'sinceVersion' => null,
'untilVersion' => null,
),
'baz' => array(
'dataType' => 'string',
'required' => false,
'description' => null,
'readonly' => false,
'sinceVersion' => null,
'untilVersion' => null,
),
),
$output
);