mtrajano / laravel-swagger

Auto generates the swagger documentation of a laravel project based on best practices and simple assumptions
167 stars 71 forks source link

Ability to use custom Router provider #42

Open trinvh opened 4 years ago

trinvh commented 4 years ago

Currently this package get all routes by calling default laravel router. Please add an ability to use custom class to get routes.

Typically we will need a new config that pass the default class to fetch all routes:

Currently:

$routes = app('Dingo\Api\Routing\Router')->getRoutes();

In this case I'm using package dingo/api so it should look like this:

$routes = [];
foreach(app('Dingo\Api\Routing\Router')->getRoutes() as $r) {
    foreach($r->getRoutes() as $rr) {
        $routes[] = $rr;
    }
}

Anw, I believe this package would be a must-have package in future. Thanks so much for your efforts!

mtrajano commented 4 years ago

Seems like a lot of people from the laravel community depend on this package. I'll prioritize this issue right after I'm doing pushing a stable release of the 0.7 branch. I've been doing some major clean up and testing in that branch and would like to get that out first. Thank you