mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-02 15:51:48 +03:00
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:
parent
4b6efc6631
commit
0845377300
@ -98,7 +98,9 @@ class JmsMetadataParser implements ParserInterface
|
||||
}
|
||||
|
||||
$exclusionStrategies = array();
|
||||
$exclusionStrategies[] = new GroupsExclusionStrategy($groups);
|
||||
if ($groups) {
|
||||
$exclusionStrategies[] = new GroupsExclusionStrategy($groups);
|
||||
}
|
||||
|
||||
$params = array();
|
||||
|
||||
|
@ -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
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user