laravel-request-docs icon indicating copy to clipboard operation
laravel-request-docs copied to clipboard

/api/* routes not included in generated docs

Open nathangoss opened this issue 3 years ago • 5 comments

Hi All,

Is there any reason why my /api/* routes are not getting included in the generated documents?

They are available when I run php artisan route:list but not in the LRD docs.

Any ideas?

Thanks!

Nathan

nathangoss avatar Sep 20 '22 06:09 nathangoss

https://github.com/rakutentech/laravel-request-docs/blob/master/config/request-docs.php#L6

Turn this to true and find out if there are any error on the page that is making it not show up.

kevincobain2000 avatar Sep 20 '22 07:09 kevincobain2000

Call to a member function get() on null

The line starting with device_id is the line throwing the error:

public function rules()
{
        // dd($this);

        return [
            'device_id' => ['required', 'string', 'unique:App\Models\ScannerDevice,device_id,'.$this->device->id],
            'location' => ['required', 'string'],
        ];
    }

This is not an api/ route, and when setting Debug to false, the route related to the above is generated just fine.

nathangoss avatar Sep 20 '22 07:09 nathangoss

Follow this: https://github.com/rakutentech/laravel-request-docs/issues/83#issuecomment-1242737419

kevincobain2000 avatar Sep 20 '22 07:09 kevincobain2000

Is there any reason why my /api/* routes are not getting included in the generated documents?

By default /api/* routes are not in the exclude pattern, the only explanation is that there is an object there that is throwing errors making the library not able to parse the rules.

kevincobain2000 avatar Sep 20 '22 07:09 kevincobain2000

Follow this: #83 (comment)

I've had a look at this comment, and have tried what is suggested, however the behaviour is not changed at all.

Is there an example of how to use the Middlewares section of the config?

nathangoss avatar Sep 20 '22 08:09 nathangoss