Coder Social home page Coder Social logo

Comments (9)

mpociot avatar mpociot commented on May 8, 2024

Please post the full stack trace of the error

from laravel-apidoc-generator.

SuperlativeEntity avatar SuperlativeEntity commented on May 8, 2024
[2016-06-05 13:15:32] local.ERROR: ErrorException: explode() expects parameter 2 to be string, object given in T:\laragon\www\transactions\Source\vendor\mpociot\laravel-apidoc-generator\src\Mpociot\ApiDoc\Generators\AbstractGenerator.php:113
Stack trace:
#0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'explode() expec...', 'T:\\laragon\\www\\...', 113, Array)
#1 T:\laragon\www\transactions\Source\vendor\mpociot\laravel-apidoc-generator\src\Mpociot\ApiDoc\Generators\AbstractGenerator.php(113): explode('@', Object(Closure))
#2 T:\laragon\www\transactions\Source\vendor\mpociot\laravel-apidoc-generator\src\Mpociot\ApiDoc\Generators\LaravelGenerator.php(32): Mpociot\ApiDoc\Generators\AbstractGenerator->getRouteGroup(Object(Closure))
#3 T:\laragon\www\transactions\Source\vendor\mpociot\laravel-apidoc-generator\src\Mpociot\ApiDoc\Commands\GenerateDocumentation.php(171): Mpociot\ApiDoc\Generators\LaravelGenerator->processRoute(Object(Illuminate\Routing\Route), Array)
#4 T:\laragon\www\transactions\Source\vendor\mpociot\laravel-apidoc-generator\src\Mpociot\ApiDoc\Commands\GenerateDocumentation.php(71): Mpociot\ApiDoc\Commands\GenerateDocumentation->processLaravelRoutes(Object(Mpociot\ApiDoc\Generators\LaravelGenerator), Array, 'api/v1/*')
#5 [internal function]: Mpociot\ApiDoc\Commands\GenerateDocumentation->handle()
#6 T:\laragon\www\transactions\Source\vendor\laravel\framework\src\Illuminate\Container\Container.php(507): call_user_func_array(Array, Array)
#7 T:\laragon\www\transactions\Source\vendor\laravel\framework\src\Illuminate\Console\Command.php(169): Illuminate\Container\Container->call(Array)
#8 T:\laragon\www\transactions\Source\vendor\symfony\console\Command\Command.php(256): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#9 T:\laragon\www\transactions\Source\vendor\laravel\framework\src\Illuminate\Console\Command.php(155): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#10 T:\laragon\www\transactions\Source\vendor\symfony\console\Application.php(791): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 T:\laragon\www\transactions\Source\vendor\symfony\console\Application.php(186): Symfony\Component\Console\Application->doRunCommand(Object(Mpociot\ApiDoc\Commands\GenerateDocumentation), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#12 T:\laragon\www\transactions\Source\vendor\symfony\console\Application.php(117): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#13 T:\laragon\www\transactions\Source\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.php(107): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 T:\laragon\www\transactions\Source\artisan(35): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 {main} 

from laravel-apidoc-generator.

SuperlativeEntity avatar SuperlativeEntity commented on May 8, 2024

It seems that I have a route that is a closure which your code cannot process. I removed the closure and it generates fine now.

from laravel-apidoc-generator.

SuperlativeEntity avatar SuperlativeEntity commented on May 8, 2024

Thanks man! You're a legend...

from laravel-apidoc-generator.

CrixuAMG avatar CrixuAMG commented on May 8, 2024

This issue still exists :/ I get the same errors as @SuperlativeEntity, using the following code:
`$api->get('/unauthorize', function(){
Artisan::call('codebase:unauthorize');

    return "Unauthorized any expired codebases";
});`

from laravel-apidoc-generator.

mpociot avatar mpociot commented on May 8, 2024

@CrixuAMG Ahh - seems like you're using Dingo, right?

This issue might be only related to standard Laravel routes.

from laravel-apidoc-generator.

CrixuAMG avatar CrixuAMG commented on May 8, 2024

@mpociot I am indeed using Dingo.
The errors I'm getting (which are on a localhosted Linux environment, so I can't copy/paste them) don't have any mention about Dingo, aside from the fact that the router I'm using is Dingo.
The command I use is: php artisan api:generate --router="dingo" --routePrefix="v1" --force -vvv

from laravel-apidoc-generator.

mpociot avatar mpociot commented on May 8, 2024

Alright - fixed this in 1.6.5 and added a test for it too 👍

from laravel-apidoc-generator.

CrixuAMG avatar CrixuAMG commented on May 8, 2024

Thanks, no more errors! 😃 👍

from laravel-apidoc-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.