diff --git a/src/Support/OperationExtensions/ErrorResponsesExtension.php b/src/Support/OperationExtensions/ErrorResponsesExtension.php index de7cf3bf..92644f54 100644 --- a/src/Support/OperationExtensions/ErrorResponsesExtension.php +++ b/src/Support/OperationExtensions/ErrorResponsesExtension.php @@ -84,7 +84,10 @@ private function attachCustomRequestExceptions(FunctionType $methodType) $formRequest = $this->infer->analyzeClass($formRequest->name); - if ($formRequest->hasMethodDefinition('rules')) { + if ( + $formRequest->hasMethodDefinition('rules') + || $formRequest->hasMethodDefinition('after') + ) { $methodType->exceptions = [ ...$methodType->exceptions, new ObjectType(ValidationException::class),