Geni automatically documents your request bodies by statically analyzing validation rules — no docblock comments, no annotations, no manual schema writing. Wherever you define validation in your Laravel application, Geni reads those rules at parse time and converts them into accurate OpenAPI request body schemas.
Supported Validation Sources
Geni inspects three distinct sources of validation rules in your controller actions.
When a controller action type-hints a class that extends Illuminate\Foundation\Http\FormRequest, Geni resolves that class and parses the array returned by its rules() method:
Inline $request->validate()
When validation is performed directly inside the controller method, Geni parses the rules array passed to validate():
Validator::make()
When you use the Validator facade or helper, Geni reads the rules passed as the second argument:
Validation Rule Mapping
Geni maps Laravel validation rules to their OpenAPI JSON Schema equivalents:
When Geni detects a file, image, or mimes rule on any field in a request, it automatically switches the request body media type from application/json to multipart/form-data. No additional configuration is required.
For example, because cover_image carries the image rule in StoreArticleRequest, Geni documents the entire request body as multipart/form-data and marks cover_image with format: "binary":
The resulting OpenAPI schema for cover_image becomes:
Use dedicated Form Request classes (extending FormRequest) as your preferred validation pattern. They give Geni the clearest static signal, keep your controller methods lean, and produce the most accurate OpenAPI schemas.