api: Can't generate API documentation.

After dingo/blueprint last update, getting message

  [ErrorException]
  Missing argument 4 for Dingo\Blueprint\Blueprint::generate(), called in /~/vendor/dingo/api/src/Console/Comm
  and/Docs.php on line 95 and defined

after running artisan api:docs --output-file docs.md

About this issue

  • Original URL
  • State: open
  • Created 8 years ago
  • Reactions: 11
  • Comments: 33 (3 by maintainers)

Most upvoted comments

I’m facing the same issue [ErrorException] Missing argument 4 for Dingo\Blueprint\Blueprint::generate(), called in vendor/dingo/api/src/Console/Command/Docs.php on line 95 and defined I put empty string as a fourth parameter in $contents = $this->blueprint->generate($this->getControllers(), $this->getDocName(), $this->getVersion(), ''); at line 95 in the “handle” method inside “vendor/dingo/api/src/Console/Command/Docs.php” and it worked fine for me. it’s just a workaround and I hope it helps. thanks

I try a "dingo/api": "dev-master" but the command artisan api:docs --output-file docs.md -vvv return

[InvalidArgumentException]
Expected a string. Got: boolean
Exception trace: () at /home/vagrant/Projects/BePaddle/vendor/webmozart/assert/src/Assert.php:133 Webmozart\Assert\Assert::string() at /home/vagrant/Projects/BePaddle/vendor/webmozart/assert/src/Assert.php:142 Webmozart\Assert\Assert::stringNotEmpty() at /home/vagrant/Projects/BePaddle/vendor/phpdocumentor/reflection-docblock/src/DocBlockFactory.php:84 phpDocumentor\Reflection\DocBlockFactory->create() at /home/vagrant/Projects/BePaddle/vendor/dingo/blueprint/src/Resource.php:144 Dingo\Blueprint\Resource->getDescription() at /home/vagrant/Projects/BePaddle/vendor/dingo/blueprint/src/Blueprint.php:145 Dingo\Blueprint\Blueprint->Dingo\Blueprint{closure}() at /home/vagrant/Projects/BePaddle/vendor/laravel/framework/src/Illuminate/Support/Collection.php:146 Illuminate\Support\Collection->each() at /home/vagrant/Projects/BePaddle/vendor/dingo/blueprint/src/Blueprint.php:193 Dingo\Blueprint\Blueprint->generateContentsFromResources() at /home/vagrant/Projects/BePaddle/vendor/dingo/blueprint/src/Blueprint.php:114 Dingo\Blueprint\Blueprint->generate() at /home/vagrant/Projects/BePaddle/vendor/dingo/api/src/Console/Command/Docs.php:96 Dingo\Api\Console\Command\Docs->handle() at n/a:n/a call_user_func_array() at /home/vagrant/Projects/BePaddle/vendor/laravel/framework/src/Illuminate/Container/Container.php:507 Illuminate\Container\Container->call() at /home/vagrant/Projects/BePaddle/vendor/laravel/framework/src/Illuminate/Console/Command.php:169 Illuminate\Console\Command->execute() at /home/vagrant/Projects/BePaddle/vendor/symfony/console/Command/Command.php:256 Symfony\Component\Console\Command\Command->run() at /home/vagrant/Projects/BePaddle/vendor/laravel/framework/src/Illuminate/Console/Command.php:155 Illuminate\Console\Command->run() at /home/vagrant/Projects/BePaddle/vendor/symfony/console/Application.php:791 Symfony\Component\Console\Application->doRunCommand() at /home/vagrant/Projects/BePaddle/vendor/symfony/console/Application.php:186 Symfony\Component\Console\Application->doRun() at /home/vagrant/Projects/BePaddle/vendor/symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at /home/vagrant/Projects/BePaddle/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:107 Illuminate\Foundation\Console\Kernel->handle() at /home/vagrant/Projects/BePaddle/artisan:35

Same issue here.

Same issue here.

Same issue here.

Same issue here.

Still getting this error :
[InvalidArgumentException] Expected a string. Got: boolean

Fixed it by commenting out https://github.com/phpDocumentor/ReflectionDocBlock/blob/master/src/DocBlockFactory.php#L84. Not sure the negative effects of this but it allows me to generate the docs which is what I need for now.

@hskrasek in fact that did work, forgot about stability settings mentioned by @johannesschobel Thank you for the temporary fix, hope this will get resolved soon. Cheers.

@mohamed-atef thanks! that worked as a dirty hack to at least get our documents published. Would be helpful if we get an official fix on this.

[Solution] checkout master branch "dingo/api": "dev-master",

add min stability and prefer stable option to composer.json "minimum-stability": "dev", "prefer-stable" : true