dedoc / scramble

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

Validation parsing: ignore required on sometimes rule #492

Closed lakuapik closed 1 month ago

lakuapik commented 1 month ago

Hi, thanks for this great package, i've been using it and it is awesome!

This PR add additional check for marking a validation required.

Context: in laravel we have sometimes validation rule which makes the field required only if the field are present. Atm, scramble parsed sometimes|required as required, it should be parsed as optional.

Reference: https://laravel.com/docs/11.x/validation#validating-when-present

Feel free to accept or drop this PR, thank you!