Skip to content

[Bug]: Error while working with array data in request #1058

Description

@chaikivskyi

Description

When sending the include query parameter as a array of strings(e.g. ?include[]=metadata), validation fails with the following error:

Cannot use param value "metadata". JSON array expected.

Current validation rules

$request->validate([
    'include' => ['sometimes', 'array'],
    'include.*' => ['string', Rule::in(['metadata'])],
]);

Observed result

The UI shows a validation error even though metadata is an allowed value.

Image

How to reproduce the bug

Use this request validaiton rules

$request->validate([
    'include' => ['sometimes', 'array'],
    'include.*' => ['string', Rule::in(['metadata'])],
]);

Package Version

0.13.10

PHP Version

8.4

Laravel Version

12

Which operating systems does with happen with?

Linux

Notes

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions