Skip to content

Add support for Laravel's fluent File validation rule#1185

Open
squiaios wants to merge 1 commit into
dedoc:mainfrom
squiaios:improve-file-rule
Open

Add support for Laravel's fluent File validation rule#1185
squiaios wants to merge 1 commit into
dedoc:mainfrom
squiaios:improve-file-rule

Conversation

@squiaios

Copy link
Copy Markdown

Adds support for the Illuminate\Validation\Rules\File validation rule.

With this change, it now correctly transforms the fluent File rule (and ImageFile) into OpenAPI schema definitions. (https://laravel.com/docs/13.x/validation#validating-files)

This ensures that constraints like file types, minimum/maximum sizes, and image dimensions are accurately reflected in the generated documentation.

@romalytvynenko

Copy link
Copy Markdown
Member

@squiaios is this PR created by AI?

@squiaios

Copy link
Copy Markdown
Author

Hello, only the line (fn () => $this->buildValidationRules())->call($rule), was made by AI to resolve the binding issue on protected function, otherwise it's by myself

@romalytvynenko

Copy link
Copy Markdown
Member

I'm not sure I'm following how and why it works. Also why existing rules documentation API is not working here? (see how enum and other rules are implemented)

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

Successfully merging this pull request may close these issues.

2 participants