Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mammadataei opened this issue Aug 24, 2024 · 3 comments

Comments

@mammadataei
Copy link

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
Copy link
Member

@mammadataei this is really a great catch

@mammadataei
Copy link
Author

Any updates?

@romalytvynenko
Copy link
Member

@mammadataei no updates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants