Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DunglasApiParser: Maximum function nesting level of '10000' reached, aborting #678

Closed
Drachenkaetzchen opened this issue Jul 16, 2015 · 14 comments
Labels

Comments

@Drachenkaetzchen
Copy link

Hi,

I use NelmoApiDocBundle with DunglasAPI. In one model, I have a self-referencing relation:

/**
 * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
 * @Gedmo\Tree(type="nested")
 * @ORM\Table(indexes={@ORM\Index(columns={"lft"}),@ORM\Index(columns={"rgt"})})
 * The entity for our footprint categories
 * @TargetService(uri="/api/footprint_categories")
 */
class FootprintCategory extends AbstractCategory
{
    /**
     * @Gedmo\TreeParent
     * @ORM\ManyToOne(targetEntity="FootprintCategory", inversedBy="children")
     * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="CASCADE")
     * @Groups({"default"})
     */
    protected $parent;

    /**
     * @ORM\OneToMany(targetEntity="FootprintCategory", mappedBy="parent")
     * @ORM\OrderBy({"lft" = "ASC"})
     * @Groups({"default"})
     */
    protected $children;

This causes NelmioApiDocBundle to hit the recursion limit. Some of the backtrace lines:

[Thu Jul 16 17:53:40.415381 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP Fatal error:  Maximum function nesting level of '10000' reached, aborting! in Unknown on line 0
[Thu Jul 16 17:53:40.415386 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP Stack trace:
[Thu Jul 16 17:53:40.415389 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   1. {main}() /home/felicitus/public_html/PartKeepr/web/app_dev.php:0
[Thu Jul 16 17:53:40.415430 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   2. Symfony\\Component\\HttpKernel\\Kernel->handle($request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = array (...) }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = array (...) }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = array (...); protected $cacheControl = array (...) }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = '/api/doc'; protected $requestUri = '/~felicitus/PartKeepr/web/app_dev.php/api/doc'; protected $baseUrl = '/~felicitus/PartKeepr/web/app_dev.php'; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = class Symfony\\Component\\HttpFoundation\\Session\\Session { protected $storage = class Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage { ... }; private $flashName = 'flashes'; private $attributeName = 'attributes' }; protected $locale = NULL; protected $defaultLocale = 'en' }, $type = *uninitialized*, $catch = *uninitialized*) /home/felicitus/public_html/PartKeepr/web/app_dev.php:28
[Thu Jul 16 17:53:40.415463 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   3. Symfony\\Component\\HttpKernel\\DependencyInjection\\ContainerAwareHttpKernel->handle($request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = array (...) }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = array (...) }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = array (...); protected $cacheControl = array (...) }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = '/api/doc'; protected $requestUri = '/~felicitus/PartKeepr/web/app_dev.php/api/doc'; protected $baseUrl = '/~felicitus/PartKeepr/web/app_dev.php'; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = class Symfony\\Component\\HttpFoundation\\Session\\Session { protected $storage = class Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage { ... }; private $flashName = 'flashes'; private $attributeName = 'attributes' }; protected $locale = NULL; protected $defaultLocale = 'en' }, $type = 1, $catch = TRUE) /home/felicitus/public_html/PartKeepr/app/bootstrap.php.cache:2428
[Thu Jul 16 17:53:40.415492 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   4. Symfony\\Component\\HttpKernel\\HttpKernel->handle($request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = array (...) }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = array (...) }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = array (...); protected $cacheControl = array (...) }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = '/api/doc'; protected $requestUri = '/~felicitus/PartKeepr/web/app_dev.php/api/doc'; protected $baseUrl = '/~felicitus/PartKeepr/web/app_dev.php'; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = class Symfony\\Component\\HttpFoundation\\Session\\Session { protected $storage = class Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage { ... }; private $flashName = 'flashes'; private $attributeName = 'attributes' }; protected $locale = NULL; protected $defaultLocale = 'en' }, $type = 1, $catch = TRUE) /home/felicitus/public_html/PartKeepr/app/bootstrap.php.cache:3206
[Thu Jul 16 17:53:40.415521 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   5. Symfony\\Component\\HttpKernel\\HttpKernel->handleRaw($request = class Symfony\\Component\\HttpFoundation\\Request { public $attributes = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $request = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $query = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $server = class Symfony\\Component\\HttpFoundation\\ServerBag { protected $parameters = array (...) }; public $files = class Symfony\\Component\\HttpFoundation\\FileBag { protected $parameters = array (...) }; public $cookies = class Symfony\\Component\\HttpFoundation\\ParameterBag { protected $parameters = array (...) }; public $headers = class Symfony\\Component\\HttpFoundation\\HeaderBag { protected $headers = array (...); protected $cacheControl = array (...) }; protected $content = NULL; protected $languages = NULL; protected $charsets = NULL; protected $encodings = NULL; protected $acceptableContentTypes = NULL; protected $pathInfo = '/api/doc'; protected $requestUri = '/~felicitus/PartKeepr/web/app_dev.php/api/doc'; protected $baseUrl = '/~felicitus/PartKeepr/web/app_dev.php'; protected $basePath = NULL; protected $method = 'GET'; protected $format = NULL; protected $session = class Symfony\\Component\\HttpFoundation\\Session\\Session { protected $storage = class Symfony\\Component\\HttpFoundation\\Session\\Storage\\NativeSessionStorage { ... }; private $flashName = 'flashes'; private $attributeName = 'attributes' }; protected $locale = NULL; protected $defaultLocale = 'en' }, $type = 1) /home/felicitus/public_html/PartKeepr/app/bootstrap.php.cache:3055
[Thu Jul 16 17:53:40.415537 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   6. call_user_func_array:{/home/felicitus/public_html/PartKeepr/app/bootstrap.php.cache:3093}(array (0 => class Nelmio\\ApiDocBundle\\Controller\\ApiDocController { protected $container = class appDevDebugProjectContainer { ... } }, 1 => 'indexAction'), array (0 => 'default')) /home/felicitus/public_html/PartKeepr/app/bootstrap.php.cache:3093
[Thu Jul 16 17:53:40.415543 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   7. Nelmio\\ApiDocBundle\\Controller\\ApiDocController->indexAction($view = 'default') /home/felicitus/public_html/PartKeepr/app/bootstrap.php.cache:3093
[Thu Jul 16 17:53:40.415549 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   8. Nelmio\\ApiDocBundle\\Extractor\\ApiDocExtractor->all($view = 'default') /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Controller/ApiDocController.php:25
[Thu Jul 16 17:53:40.416422 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP   9. Nelmio\\ApiDocBundle\\Extractor\\ApiDocExtractor->extractAnnotations($routes = array ('_assetic_bf59c3c' => class Symfony\\Component\\Routing\\Route { private $path = '/css/bf59c3c.css'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_bf59c3c_0' => class Symfony\\Component\\Routing\\Route { private $path = '/css/bf59c3c_theme-neptune-touch-all_1.css'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_bf59c3c_1' => class Symfony\\Component\\Routing\\Route { private $path = '/css/bf59c3c_ux-all_2.css'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_bf59c3c_2' => class Symfony\\Component\\Routing\\Route { private $path = '/css/bf59c3c_charts-all_3.css'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_bf59c3c_3' => class Symfony\\Component\\Routing\\Route { private $path = '/css/bf59c3c_PartKeepr_4.css'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_245ec67' => class Symfony\\Component\\Routing\\Route { private $path = '/images/245ec67.ico'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_245ec67_0' => class Symfony\\Component\\Routing\\Route { private $path = '/images/245ec67_favicon_1.ico'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_0' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_ext-all-debug_1.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_1' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_charts_2.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_2' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_ux_3.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_3' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_Ext.data.Model-EXTJS-15037_4.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_4' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_i18n_5.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_5' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_JsonWithAssociationsWriter_6.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_6' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_PartKeepr_7.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_7' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_compat_8.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_8' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_NumericField_9.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_9' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_CurrencyNumberField_10.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_10' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_SearchField_11.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_11' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_Iframe_12.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_12' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_ClearableComboBox_13.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_13' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_ServiceCall_14.js'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = NULL; private $condition = '' }, '_assetic_9bd905c_14' => class Symfony\\Component\\Routing\\Route { private $path = '/js/compiled/main_locale_15.js'; private $host = ''; priv
[Thu Jul 16 17:53:40.416504 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP  10. Nelmio\\ApiDocBundle\\Extractor\\ApiDocExtractor->extractData($annotation = class Nelmio\\ApiDocBundle\\Annotation\\ApiDoc { private $requirements = array (); private $views = array (); private $filters = array (); private $parameters = array (); private $input = NULL; private $output = 'dunglas_api_out:PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory'; private $link = NULL; private $description = 'Retrieves the collection of FootprintCategory resources.'; private $section = NULL; private $documentation = NULL; private $resource = '/api/footprint_categories'; private $method = 'GET'; private $host = NULL; private $uri = '/api/footprint_categories'; private $response = array (); private $route = class Symfony\\Component\\Routing\\Route { private $path = '/api/footprint_categories'; private $host = ''; private $schemes = array (...); private $methods = array (...); private $defaults = array (...); private $requirements = array (...); private $options = array (...); private $compiled = class Symfony\\Component\\Routing\\CompiledRoute { ... }; private $condition = '' }; private $https = FALSE; private $authentication = FALSE; private $authenticationRoles = array (); private $cache = NULL; private $deprecated = FALSE; private $statusCodes = array (); private $resourceDescription = 'FootprintCategory'; private $responseMap = array (); private $parsedResponseMap = array (); private $tags = array () }, $route = class Symfony\\Component\\Routing\\Route { private $path = '/api/footprint_categories'; private $host = ''; private $schemes = array (); private $methods = array (0 => 'GET'); private $defaults = array ('_controller' => 'Dunglas\\\\ApiBundle\\\\Controller\\\\ResourceController::cgetAction', '_resource' => 'FootprintCategory'); private $requirements = array ('_method' => 'GET'); private $options = array ('compiler_class' => 'Symfony\\\\Component\\\\Routing\\\\RouteCompiler'); private $compiled = class Symfony\\Component\\Routing\\CompiledRoute { private $variables = array (...); private $tokens = array (...); private $staticPrefix = '/api/footprint_categories'; private $regex = '#^/api/footprint_categories$#s'; private $pathVariables = array (...); private $hostVariables = array (...); private $hostRegex = NULL; private $hostTokens = array (...) }; private $condition = '' }, $method = class ReflectionMethod { public $name = 'cgetAction'; public $class = 'Dunglas\\\\ApiBundle\\\\Controller\\\\ResourceController' }) /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Extractor/ApiDocExtractor.php:147
[Thu Jul 16 17:53:40.416519 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP  11. Nelmio\\ApiDocBundle\\Parser\\DunglasApiParser->parse($item = array ('class' => 'dunglas_api_out:PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory', 'groups' => array (), 'options' => array ())) /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Extractor/ApiDocExtractor.php:332
[Thu Jul 16 17:53:40.416542 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP  12. Nelmio\\ApiDocBundle\\Parser\\DunglasApiParser->parseClass($resource = class DunglasApiBundleApiResource_0000000026ef992f000000005b7ce93439063238aa053e1b008676075132a1f6 { private $valueHolder55a7d37897540744022397 = class Dunglas\\ApiBundle\\Api\\Resource { private $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory'; private $itemOperations = array (...); private $collectionOperations = array (...); private $filters = array (...); private $normalizationContext = array (...); private $denormalizationContext = array (...); private $validationGroups = NULL; private $shortName = 'FootprintCategory' }; private $initializer55a7d37897556734366159 = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:entityClass = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:itemOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:collectionOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:filters = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:normalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:denormalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:validationGroups = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:shortName = NULL }, $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory', $io = 'dunglas_api_out') /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Parser/DunglasApiParser.php:77
[Thu Jul 16 17:53:40.416570 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP  13. Nelmio\\ApiDocBundle\\Parser\\DunglasApiParser->parseAttribute($resource = class DunglasApiBundleApiResource_0000000026ef992f000000005b7ce93439063238aa053e1b008676075132a1f6 { private $valueHolder55a7d37897540744022397 = class Dunglas\\ApiBundle\\Api\\Resource { private $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory'; private $itemOperations = array (...); private $collectionOperations = array (...); private $filters = array (...); private $normalizationContext = array (...); private $denormalizationContext = array (...); private $validationGroups = NULL; private $shortName = 'FootprintCategory' }; private $initializer55a7d37897556734366159 = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:entityClass = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:itemOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:collectionOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:filters = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:normalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:denormalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:validationGroups = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:shortName = NULL }, $attributeMetadata = class Dunglas\\ApiBundle\\Mapping\\AttributeMetadata { public $name = 'parent'; public $types = array (0 => class PropertyInfo\\Type { ... }); public $description = NULL; public $readable = TRUE; public $writable = TRUE; public $required = FALSE; public $normalizationLink = FALSE; public $denormalizationLink = FALSE; public $iri = NULL }, $io = 'dunglas_api_out', $type = *uninitialized*) /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Parser/DunglasApiParser.php:104
[Thu Jul 16 17:53:40.416594 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP  14. Nelmio\\ApiDocBundle\\Parser\\DunglasApiParser->parseClass($resource = class DunglasApiBundleApiResource_0000000026ef992f000000005b7ce93439063238aa053e1b008676075132a1f6 { private $valueHolder55a7d37897540744022397 = class Dunglas\\ApiBundle\\Api\\Resource { private $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory'; private $itemOperations = array (...); private $collectionOperations = array (...); private $filters = array (...); private $normalizationContext = array (...); private $denormalizationContext = array (...); private $validationGroups = NULL; private $shortName = 'FootprintCategory' }; private $initializer55a7d37897556734366159 = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:entityClass = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:itemOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:collectionOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:filters = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:normalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:denormalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:validationGroups = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:shortName = NULL }, $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory', $io = 'dunglas_api_out') /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Parser/DunglasApiParser.php:184
[Thu Jul 16 17:53:40.416621 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP  15. Nelmio\\ApiDocBundle\\Parser\\DunglasApiParser->parseAttribute($resource = class DunglasApiBundleApiResource_0000000026ef992f000000005b7ce93439063238aa053e1b008676075132a1f6 { private $valueHolder55a7d37897540744022397 = class Dunglas\\ApiBundle\\Api\\Resource { private $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory'; private $itemOperations = array (...); private $collectionOperations = array (...); private $filters = array (...); private $normalizationContext = array (...); private $denormalizationContext = array (...); private $validationGroups = NULL; private $shortName = 'FootprintCategory' }; private $initializer55a7d37897556734366159 = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:entityClass = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:itemOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:collectionOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:filters = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:normalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:denormalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:validationGroups = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:shortName = NULL }, $attributeMetadata = class Dunglas\\ApiBundle\\Mapping\\AttributeMetadata { public $name = 'parent'; public $types = array (0 => class PropertyInfo\\Type { ... }); public $description = NULL; public $readable = TRUE; public $writable = TRUE; public $required = FALSE; public $normalizationLink = FALSE; public $denormalizationLink = FALSE; public $iri = NULL }, $io = 'dunglas_api_out', $type = *uninitialized*) /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Parser/DunglasApiParser.php:104
[Thu Jul 16 17:53:40.416645 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP  16. Nelmio\\ApiDocBundle\\Parser\\DunglasApiParser->parseClass($resource = class DunglasApiBundleApiResource_0000000026ef992f000000005b7ce93439063238aa053e1b008676075132a1f6 { private $valueHolder55a7d37897540744022397 = class Dunglas\\ApiBundle\\Api\\Resource { private $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory'; private $itemOperations = array (...); private $collectionOperations = array (...); private $filters = array (...); private $normalizationContext = array (...); private $denormalizationContext = array (...); private $validationGroups = NULL; private $shortName = 'FootprintCategory' }; private $initializer55a7d37897556734366159 = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:entityClass = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:itemOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:collectionOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:filters = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:normalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:denormalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:validationGroups = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:shortName = NULL }, $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory', $io = 'dunglas_api_out') /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Parser/DunglasApiParser.php:184
[Thu Jul 16 17:53:40.416671 2015] [:error] [pid 18881] [client 127.0.0.1:33605] PHP  17. Nelmio\\ApiDocBundle\\Parser\\DunglasApiParser->parseAttribute($resource = class DunglasApiBundleApiResource_0000000026ef992f000000005b7ce93439063238aa053e1b008676075132a1f6 { private $valueHolder55a7d37897540744022397 = class Dunglas\\ApiBundle\\Api\\Resource { private $entityClass = 'PartKeepr\\\\FootprintBundle\\\\Entity\\\\FootprintCategory'; private $itemOperations = array (...); private $collectionOperations = array (...); private $filters = array (...); private $normalizationContext = array (...); private $denormalizationContext = array (...); private $validationGroups = NULL; private $shortName = 'FootprintCategory' }; private $initializer55a7d37897556734366159 = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:entityClass = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:itemOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:collectionOperations = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:filters = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:normalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:denormalizationContext = array (); private ${Dunglas\\ApiBundle\\Api\\Resource}:validationGroups = NULL; private ${Dunglas\\ApiBundle\\Api\\Resource}:shortName = NULL }, $attributeMetadata = class Dunglas\\ApiBundle\\Mapping\\AttributeMetadata { public $name = 'parent'; public $types = array (0 => class PropertyInfo\\Type { ... }); public $description = NULL; public $readable = TRUE; public $writable = TRUE; public $required = FALSE; public $normalizationLink = FALSE; public $denormalizationLink = FALSE; public $iri = NULL }, $io = 'dunglas_api_out', $type = *uninitialized*) /home/felicitus/public_html/PartKeepr/vendor/nelmio/api-doc-bundle/Nelmio/ApiDocBundle/Parser/DunglasApiParser.php:104
@willdurand
Copy link
Collaborator

poke @dunglas

@willdurand willdurand added the bug label Oct 27, 2015
@dunglas
Copy link
Contributor

dunglas commented Oct 27, 2015

@FELICITUS is this bug stil accurate?

@Drachenkaetzchen
Copy link
Author

I need to re-test, is the NelmioApiDocBundle working again with latest master?

@willdurand
Copy link
Collaborator

@FELICITUS well, deprecated notices put aside, yes.

@dunglas
Copy link
Contributor

dunglas commented Oct 28, 2015

Not with dev-master of ApiBundle. Only 1.0 will be supported until the release of 2.0.

@willdurand
Copy link
Collaborator

ah right!

@amerryma
Copy link

amerryma commented Nov 5, 2015

Were you able to resolve this without updating the api-bundle to 2.0?

@Drachenkaetzchen
Copy link
Author

I just tested it with the PR of api-platform/core#225, but this issue still persists.

@teohhanhui
Copy link
Contributor

Isn't this an issue with breaking circular reference? You can avoid the problem by not having circular references in your serialization (by properly using serialization groups for normalization/denormalization)...

@marek-l
Copy link

marek-l commented Jan 14, 2016

Any news with this issue?

@marcin-piela
Copy link

https://github.com/nelmio/NelmioApiDocBundle/blob/master/Parser/DunglasApiParser.php#L184

I think in DunglasApiParser.php we need to add statement:

if ($class != $resource->getEntityClass()) {
    $data['children'] = $this->parseClass($resource, $class, $io);
} else {
    $data['children'] = [];
}

@nicolasricci
Copy link

thanks @marcin-piela for the snippet
+1 to fix this issue.

@teohhanhui
Copy link
Contributor

@dunglas This is not really fixed yet.

A proper cycle detection/breaking mechanism needs to be implemented for handling e.g. the case of:

(AggregateOffer)-[:offers]->(Offer)-[:addOn]->(Offer)

@teohhanhui
Copy link
Contributor

Refer to #121 which uses a visited stack.

teohhanhui added a commit to teohhanhui/api-platform-core that referenced this issue Feb 18, 2016
teohhanhui added a commit to teohhanhui/api-platform-core that referenced this issue Feb 18, 2016
teohhanhui added a commit to teohhanhui/NelmioApiDocBundle that referenced this issue Feb 18, 2016
teohhanhui added a commit to teohhanhui/api-platform-core that referenced this issue Mar 8, 2016
teohhanhui added a commit to teohhanhui/api-platform-core that referenced this issue Mar 8, 2016
adelplace pushed a commit to bein-sports/NelmioApiDocBundle that referenced this issue Jul 22, 2016
adelplace pushed a commit to bein-sports/NelmioApiDocBundle that referenced this issue Aug 9, 2016
adelplace pushed a commit to bein-sports/NelmioApiDocBundle that referenced this issue Aug 9, 2016
Fixes nelmio#678, reverts nelmio#800

Conflicts:
	Parser/DunglasApiParser.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants