You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on package which I believe will build auto generated api documentation. It works based on tests coverage using middleware like this:
public function handle(Request $request, Closure $next)
{
$response = $next($request);
if(Config::get('app.debug'))
$this->docDocDocService->parse($request, $response);
return $response;
}
I can get request and response from each test, so I have status codes, parameters, bodies, headers, etc. Now I want to get validation rules from form requests. It works fine with form requests injected to the action as a parameter, as I can see json api server requests are not injected to action, but are initializing inside the actions, like this:
The problem with Laravel form requests is they are validated as soon as they are resolved by the service container. So getting them at any point other than the point you want validation to occur isn't possible. That's a design problem with Laravel's form requests, rather than this package.
So for the moment this isn't possible.
I'm going to have to decouple validation from form requests to deliver #39. But I'm not sure when I'll get to that as this package is already taking an incredible amount of my time, and I'm starting to get behind on real work as a result.
I am working on package which I believe will build auto generated api documentation. It works based on tests coverage using middleware like this:
I can get request and response from each test, so I have status codes, parameters, bodies, headers, etc. Now I want to get validation rules from form requests. It works fine with form requests injected to the action as a parameter, as I can see json api server requests are not injected to action, but are initializing inside the actions, like this:
I can't see any possibility to get it inside the scope of the request, do you?
The text was updated successfully, but these errors were encountered: