mirror of
https://github.com/retailcrm/NelmioApiDocBundle.git
synced 2025-02-09 02:59:27 +03:00
Always require phpdocumentor/reflection-docblock (#1186)
This commit is contained in:
parent
b5b0eb1c16
commit
eda4a0a340
@ -17,7 +17,6 @@ use Nelmio\ApiDocBundle\Describer\RouteDescriber;
|
||||
use Nelmio\ApiDocBundle\Describer\SwaggerPhpDescriber;
|
||||
use Nelmio\ApiDocBundle\ModelDescriber\JMSModelDescriber;
|
||||
use Nelmio\ApiDocBundle\Routing\FilteredRouteCollectionBuilder;
|
||||
use phpDocumentor\Reflection\DocBlockFactory;
|
||||
use Symfony\Component\Config\FileLocator;
|
||||
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
|
||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||
@ -109,9 +108,8 @@ final class NelmioApiDocExtension extends Extension implements PrependExtensionI
|
||||
));
|
||||
|
||||
// Import services needed for each library
|
||||
if (class_exists(DocBlockFactory::class)) {
|
||||
$loader->load('php_doc.xml');
|
||||
}
|
||||
$loader->load('php_doc.xml');
|
||||
|
||||
if (interface_exists(ParamInterface::class)) {
|
||||
$loader->load('fos_rest.xml');
|
||||
}
|
||||
@ -127,18 +125,14 @@ final class NelmioApiDocExtension extends Extension implements PrependExtensionI
|
||||
|
||||
// JMS metadata support
|
||||
if ($config['models']['use_jms']) {
|
||||
$arguments = [
|
||||
new Reference('jms_serializer.metadata_factory'),
|
||||
new Reference('jms_serializer.naming_strategy'),
|
||||
new Reference('nelmio_api_doc.model_describers.swagger_property_annotation_reader'),
|
||||
];
|
||||
// phpdocumentor is not a hard requirement, only use if available
|
||||
if (class_exists(DocBlockFactory::class)) {
|
||||
$arguments[] = new Reference('nelmio_api_doc.model_describers.phpdoc_property_annotation_reader');
|
||||
}
|
||||
$container->register('nelmio_api_doc.model_describers.jms', JMSModelDescriber::class)
|
||||
->setPublic(false)
|
||||
->setArguments($arguments)
|
||||
->setArguments([
|
||||
new Reference('jms_serializer.metadata_factory'),
|
||||
new Reference('jms_serializer.naming_strategy'),
|
||||
new Reference('nelmio_api_doc.model_describers.swagger_property_annotation_reader'),
|
||||
new Reference('nelmio_api_doc.model_describers.phpdoc_property_annotation_reader'),
|
||||
])
|
||||
->addTag('nelmio_api_doc.model_describer', ['priority' => 50]);
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,6 @@
|
||||
|
||||
namespace Nelmio\ApiDocBundle\ModelDescriber;
|
||||
|
||||
use EXSyst\Component\Swagger\Items;
|
||||
use EXSyst\Component\Swagger\Schema;
|
||||
use phpDocumentor\Reflection\DocBlock\Tags\Var_;
|
||||
use phpDocumentor\Reflection\DocBlockFactory;
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace Nelmio\ApiDocBundle\ModelDescriber;
|
||||
|
||||
use Doctrine\Common\Annotations\Reader;
|
||||
use EXSyst\Component\Swagger\Items;
|
||||
use EXSyst\Component\Swagger\Schema;
|
||||
use Swagger\Annotations\Property as SwgProperty;
|
||||
use const Swagger\Annotations\UNDEFINED;
|
||||
|
@ -19,7 +19,8 @@
|
||||
"symfony/framework-bundle": "^3.4|^4.0",
|
||||
"symfony/property-info": "^3.4|^4.0",
|
||||
"exsyst/swagger": "~0.3",
|
||||
"zircote/swagger-php": "^2.0.9"
|
||||
"zircote/swagger-php": "^2.0.9",
|
||||
"phpdocumentor/reflection-docblock": "^3.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"symfony/templating": "^3.4|^4.0",
|
||||
@ -39,13 +40,11 @@
|
||||
"doctrine/annotations": "^1.2",
|
||||
"doctrine/common": "^2.4",
|
||||
|
||||
"phpdocumentor/reflection-docblock": "^3.1",
|
||||
"api-platform/core": "^2.1.0",
|
||||
"friendsofsymfony/rest-bundle": "^2.0",
|
||||
"jms/serializer-bundle": "^2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"phpdocumentor/reflection-docblock": "For parsing php docs.",
|
||||
"api-platform/core": "For using an API oriented framework.",
|
||||
"friendsofsymfony/rest-bundle": "For using the parameters annotations."
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user