dingo / api

A RESTful API package for the Laravel and Lumen frameworks.
BSD 3-Clause "New" or "Revised" License
9.32k stars 1.25k forks source link

Can't generate API documentation. #1079

Open alex-rs opened 8 years ago

alex-rs commented 8 years ago

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

ghost commented 8 years ago

Same issue here.

zhangshaocong commented 8 years ago

Same issue here.

DamianZ commented 8 years ago

Same issue here.

zhangshaocong commented 8 years ago

Same issue here.

anthonydarwesh commented 8 years ago

Same here.

Frondor commented 8 years ago

Confirmed

LynX39 commented 8 years ago

Same issue in a Laravel 5.2.

jozefbalun commented 8 years ago

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

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

LynX39 commented 8 years ago

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

jozefbalun commented 8 years ago

sry, it is another issue probably

mohamed-atef commented 8 years ago

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

m0nsky commented 8 years ago

Same here.

deleugpn commented 8 years ago

What version? I'm not facing this issue.

kvlknctk commented 8 years ago

Same here.

ramyareye commented 8 years ago

same here!

dmachiavello commented 8 years ago

@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.

Silentscripter commented 8 years ago

Same here

johannes-z commented 8 years ago

Same here

dnmarques commented 8 years ago

Same here

sefsinalas commented 8 years ago

+1

loktarjugg commented 8 years ago

Same here

johannesschobel commented 8 years ago

I tried to switch to the latest development build by

  1. requiring "dingo/api" : "dev-master"
  2. adding the lines
"minimum-stability": "dev",
"prefer-stable": true

to the top level of the composer file

The new version is installed (both for dingo/api and dingo/blueprint. However, after running php artisan api:docs --name TEST --output-file /docs/docs.md

i get the following error:

  [InvalidArgumentException]
  Expected a string. Got: boolean

Can somebody help!? Greetings

hskrasek commented 8 years ago

Anyone experiencing this issue, would you be willing to point me in the direct of a repo or gist, or something I can use to try and re-create this issue?

lexuzieel commented 8 years ago

It happened to me just now after running composer update. It looks like it have updated dingo/blueprint to the v.1.0.6 while leaving dingo/api at v1.0.0-beta3 which in fact doesn't pass $includePath to the blueprint generator. My composer.json still includes "dingo/api": "1.0.*@dev" and it seems to be intact with the wiki.

So what I have now after update is this line here: https://github.com/dingo/api/blob/v1.0.0-beta3/src/Console/Command/Docs.php#L95 calling this line from another package: https://github.com/dingo/blueprint/blob/master/src/Blueprint.php#L83

Current master branch doesn't have this problem, so I guess it is some composer versioning problem? Could you please suggest me how I can point dingo/api to be updated to master branch?

lexuzieel commented 8 years ago

In fact here is the update log:

Updating dependencies (including require-dev)
...
  - Removing dingo/blueprint (v0.1.4)
  - Installing dingo/blueprint (v0.1.6)
    Downloading: 100%

  - Removing dingo/api (dev-master 98d3d00)
  - Installing dingo/api (v1.0.0-beta3)
    Downloading: 100%
hskrasek commented 8 years ago

If you change you're composer.json entry for dingo/api to point to dev-master, that should take care of it.

I think beta3 was tagged before that option was added. Might look into tagging a beta4 soon, which would then include the commits.

On Aug 17, 2016, at 11:30 PM, Alex notifications@github.com wrote:

In fact here is the update log:

  • Removing dingo/blueprint (v0.1.4)
  • Installing dingo/blueprint (v0.1.6) Downloading: 100%
  • Removing dingo/api (dev-master 98d3d00)
  • Installing dingo/api (v1.0.0-beta3) Downloading: 100% — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
lexuzieel commented 8 years ago

@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.

ghost commented 8 years ago

@johannesschobel 's fix totally works now working on dev-master. Don't forget to add the stability settings mentioned.

anthonydarwesh commented 8 years ago

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 commented 8 years ago

Anyone have a controller with DocBlock setup that I can use to re-create this issue?

gabriel-vasile commented 8 years ago

I have 2 laravel installs, one is 5.2 and the other 5.3. On 5.2 the documentation command works but on 5.3 I'm getting same error as @anthonydarwesh, however his fix did not work for me.

output of composer show | grep dingo: dingo/api dev-master 242411e dingo/blueprint v0.2.0

alexjose commented 8 years ago

+1

zuoRambo commented 7 years ago

i don't know which version was right 😠