dedoc / scramble

Modern Laravel OpenAPI (Swagger) documentation generator. No PHPDoc annotations required.
https://scramble.dedoc.co/
MIT License
1.24k stars 119 forks source link

Additional collection’s data won't be documented when using with paginated responses #499

Open mammadataei opened 2 months ago

mammadataei commented 2 months ago

Scramble ignores the additional collection data (i.e. insight), I think because of paginated response annotation.

class UserController
{
    /**
     * @response AnonymousResourceCollection<LengthAwarePaginator<UserResource>>
     */
    public function index(Request $request)
    {
        return UserResource::collection(User::paginate())
            ->additional([
                'insight' => [
                    'roles' => [
                        'admin' => 0,
                        'user' => 0,
                    ],
                ],
            ]);
    }
}
romalytvynenko commented 2 months ago

@mammadataei this is really a great catch

mammadataei commented 1 month ago

Any updates?

romalytvynenko commented 1 month ago

@mammadataei no updates