Open eelco2k opened 5 months ago
i think this is good to have, we can use the DTO for request validation too.
i've created a simple version of the DTO implementation in this branch with PR: https://github.com/rupadana/filament-api-service/pull/57
But as i'm trying to get it to work i notice that it would be easier to generate the docs like xolvionl/laravel-data-openapi-generator does it.... It just directly generates a swagger json from the Routes(). so no annotations needed. When i have more time i think i will convert it like this as this would be easier to maintain instead of re-running the commands for generating a transformer or something...
What happened?
Allow handlers to conform to DTO. (these also need to be created/generated...)
instead of:
use this:
where BlogData is a spatie laravel-data DTO.
The benefit would be that because the DTO knows column types etc. this information can be used to generate correct API Swagger docs for Schemas, Parameters etc.. see:
https://github.com/xolvionl/laravel-data-openapi-generator/tree/main/src/Data
How to reproduce the bug
nice to have
Package Version
latest
PHP Version
8.3
Laravel Version
11
Which operating systems does with happen with?
No response
Notes
No response