dedoc / scramble

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

Laravel-Data request object marked with `#[FromRouteParameter()]` not replaced in API route #632

Open cosmastech opened 3 days ago

cosmastech commented 3 days ago

In the route, it replaces with the controller method dependencies.

class ShowBudgetRequest extends BaseRequest
{
    public function __construct(
        #[FromRouteParameter('teamTwrn')]
        public Twrn $teamTwrn,
        #[FromRouteParameter('budgetTwrn')]
        public Twrn $budgetTwrn,
    ) {
    }
}
class BudgetController extends Controller
{
    public function show(GetBudgetCommand $command, ShowBudgetRequest $request)
    {
        // ...
    }
}

And a route /team/{teamTwrn}/budgets/{budgetTwrn} will generate to /team/{command}/budgets/{request}

romalytvynenko commented 3 days ago

@cosmastech working on it!