spatie/laravel-data) is widely used for type-safe Data Transfer Objects (DTOs), request validation, and API resource transformation in Laravel. Geni provides first-class, opt-in static analysis support for both v3 and v4. When a controller action accepts a Data class or returns one, Geni automatically generates matching OpenAPI schemas — no redundant Form Requests or manual annotations required.
Request Injection
When a controller action type-hints a class extendingSpatie\LaravelData\Data, Geni inspects that class definition and builds the full request body schema from its constructor properties and validation attributes:
Inferred Request Body Schema
Geni reads each constructor property and its attributes to produce the following inferences:name:type: string,minLength: 3,maxLength: 50, added to therequiredarray.email:type: string,format: email, added to therequiredarray.address: Nested object schema or$ref: '#/components/schemas/AddressData', not required (default isnull).bio:type: string, not required (typed asOptional).
Response Transformation
Geni automatically recognizes Data class responses across all common usage patterns:UserData::collect(...), Geni documents a 200 response with type: array whose items match the UserData schema.
Supported Validation Attributes
Geni statically parses attributes from theSpatie\LaravelData\Attributes\Validation\* namespace:
Geni never requires
spatie/laravel-data in your production environment. Static analysis runs entirely at parse time. If a project does not use Spatie Data, Geni ignores Data classes with zero runtime impact.