Validation rule Rule::enum(...) overrides description defined in public static function queryParameters() {...}, I think it should be appended instead. In the following example it only generates an entry saying Must be one of red, green, or blue..
<?php
namespace App\Http\Requests;
use App\Enums\Colors;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;
class TestRequest extends FormRequest
{
public function rules(): array
{
return [
'types.*' => [Rule::enum(Colors::class)],
];
}
public static function queryParameters(): array
{
return [
'types.*' => [
'description' => 'This text is overridden with text from enum and never shown.',
],
];
}
}
<?php
namespace App\Enums;
enum Colors: string
{
case Red = 'red';
case Green = 'green';
case Blue = 'blue';
}
Scribe version
4.19.0
PHP version
8.2.5
Framework
Laravel
Framework version
10.8.0
Scribe config
What happened?
Validation rule
Rule::enum(...)
overrides description defined inpublic static function queryParameters() {...}
, I think it should be appended instead. In the following example it only generates an entry sayingMust be one of red, green, or blue.
.Docs