-
-
Notifications
You must be signed in to change notification settings - Fork 356
Open
Labels
Description
Scribe version
5.2.0
PHP version
8.2
Laravel version
12.10.2
Scribe config
laravel.middleware.0 => "web"
laravel.middleware.1 => "scribe.auth"
auth.enabled => true
auth.placeholder => "{BEARER_TOKEN}"
examples.faker_seed => nullWhat happened?
I use the following FormRequest:
public function rules(): array
{
return [
'instagram_user_id' => [
'nullable',
],
'instagram_user_id.*' => [
'int',
];
}Users should be able to leave the instagram_user_id field empty. However, when I use the “Try it out” feature in Scribe, it doesn’t send an empty value—instead, it sends something like instagram_user_id = [null, null]. This causes a validation error because instagram_user_id.* expects integers, but gets null values instead.
Expected Behavior
When using the “Try it out” feature in Scribe, if the instagram_user_id field is left empty, the request should either:
- Not include the
instagram_user_idkey at all,
or - Send it as an empty array:
instagram_user_id: []
This way, the validation passes because:
- The field is nullable
- And there are no non-integer (e.g., null) values inside the array that would trigger the
instagram_user_id.* => intrule
Docs
- I've checked the docs, the troubleshooting guide, and existing issues, but I didn't find a solution