<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi John,</p>
<p>1. Yes, Alessio is definitely the correct person to ask. Totally.
;-D</p>
<p>2. I concur with Rebecca.</p>
<p>3. Also, there's an invisible twist. When running in the context
of CDI, field injection occurs only after a method is invoked on
an object. That's why
org.jboss.resteasy.plugins.validation.GeneralValidatorImpl.validateAllParameters()
(in module resteasy-validator-provider-11) tests</p>
<blockquote>
<p>
<blockquote type="cite"> if
((violationsContainer.isFieldsValidated()</blockquote>
</p>
</blockquote>
before throwing a ResteasyViolationException. It also explains the
presence of a validate() method in
org.jboss.resteasy.cdi.JaxrsInjectionTarget (in module
resteasy-cdi). So, in the presence of CDI, <br>
<br>
<blockquote>
<blockquote type="cite">result = invokedMethod.invoke(resource,
args);</blockquote>
</blockquote>
in MethodInjectorImpl DOES get called, but, if there are any
violations, JaxrsInjectionTarget.validate() will call
GeneralValidatorImpl.checkViolationsfromCDI(), which will throw a
ResteasyViolationException before invoking the actual method.<br>
<p>-Ron<br>
</p>
<br>
<div class="moz-cite-prefix">On 10/25/2017 02:31 PM, Rebecca Searls
wrote:<br>
</div>
<blockquote
cite="mid:CAM_r5ciPyvKzXp9fx+7koCk6wFA1_rtOpTQFMrt+GXOOfRLbQQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div class="gmail_default" style="font-size:small">I've reviewed
the code. I do not find that a method with a validation error
is called. The validation error is thrown. It is captured[1]
and returned to the caller in the Response object as an HTTP
400 error.[2]<br>
<br>
[1]<a moz-do-not-send="true"
href="https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodInvoker.java#344">https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodInvoker.java#344</a><br>
[2]<a moz-do-not-send="true"
href="https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodInvoker.java#191">https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/ResourceMethodInvoker.java#191</a><br>
<br>
<br>
</div>
<div class="gmail_default" style="font-size:small"><br>
</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Oct 25, 2017 at 5:26 AM,
Alessio Soldano <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:asoldano@redhat.com" target="_blank">asoldano@redhat.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">
<div>
<div>
<div>Hi John,<br>
</div>
sorry, I'm a bit busy atm, anyway I'm forwarding your
email to the resteasy-dev list. We'll get back to you.<br>
<br>
</div>
Cheers<br>
</div>
Alessio<br>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Tue, Oct 24, 2017 at 11:59 AM,
John O'Hara <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:johara@redhat.com" target="_blank">johara@redhat.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Alessio,
<div><br>
</div>
<div>I am not sure if you are the correct person to
ask, if not please let me if there is someone more
appropriate to ask.</div>
<div><br>
</div>
<div>I have been investigating some unexpected
behaviour in how entity validations exceptions are
propagated through WF/EAP when http post requests
are made via rest endpoints. </div>
<div><br>
</div>
<div>One thing I have noticed in the resteasy-jaxrs
module is that in org.jboss.resteasy.core.Met<wbr>hodInjectorImpl.invoke()
the method parameters are validated [1], but the
method is still invoked, irrespective of the
outcome of the call to the validator [2]</div>
<div><br>
</div>
<div>Is there is a possibility of failing a method
invocation after the validation call [1], so that
we do not invoke the method, which ends up failing
anyway due to validation exceptions? </div>
<div><br>
</div>
<div>Thanks</div>
<div><br>
</div>
<div>John</div>
<div><br>
</div>
<div>[1] <a moz-do-not-send="true"
href="https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/MethodInjectorImpl.java#L119"
target="_blank">https://github.com/resteas<wbr>y/Resteasy/blob/master/resteas<wbr>y-jaxrs/src/main/java/org/<wbr>jboss/resteasy/core/MethodInje<wbr>ctorImpl.java#L119</a></div>
<div>[2] <a moz-do-not-send="true"
href="https://github.com/resteasy/Resteasy/blob/master/resteasy-jaxrs/src/main/java/org/jboss/resteasy/core/MethodInjectorImpl.java#L140"
target="_blank">https://github.com/resteas<wbr>y/Resteasy/blob/master/resteas<wbr>y-jaxrs/src/main/java/org/<wbr>jboss/resteasy/core/MethodInje<wbr>ctorImpl.java#L140</a><span
class="HOEnZb"><font color="#888888"><span
class="m_6905387439394627917HOEnZb"><font
color="#888888"><br clear="all">
<div><br>
</div>
-- <br>
<div
class="m_6905387439394627917m_6483143836804695970gmail_signature">
<div dir="ltr">
<div>
<p
style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-weight:bold;margin:0px;padding:0px;font-size:14px;text-transform:uppercase"><span>JOHN</span> <span>O'HARA</span></p>
<p
style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px;margin:0px
0px 4px;text-transform:uppercase"><span>PRINCIPAL
SOFTWARE ENGINEER</span><span
style="color:rgb(170,170,170);margin:0px"></span></p>
<p
style="font-family:overpass,sans-serif;margin:0px;font-size:10px;color:rgb(153,153,153)"><a
moz-do-not-send="true"
href="https://www.redhat.com/"
style="color:rgb(0,136,206);margin:0px"
target="_blank">Red Hat<span></span></a></p>
<table
style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:medium"
border="0">
<tbody>
<tr>
<td width="100px"><a
moz-do-not-send="true"
href="https://red.ht/sig"
target="_blank"><img
moz-do-not-send="true"
width="90" height="auto"></a></td>
<td style="font-size:10px">
<div><a
moz-do-not-send="true"
href="https://redhat.com/trusted"
style="color:rgb(204,0,0);font-weight:bold" target="_blank">TRIED.
TESTED. TRUSTED.</a></div>
</td>
</tr>
</tbody>
</table>
<div
style="color:rgb(0,0,0);font-family:overpass,sans-serif;font-size:10px">
<div
style="color:rgb(153,153,153)"><a
moz-do-not-send="true"
href="https://twitter.com/redhatway"
title="twitter"
style="background:url("")
0px 50%/16px no-repeat
transparent;height:20px;color:rgb(119,119,119);display:inline-block;line-height:20px;padding-left:16px"
target="_blank">@redhatway</a> <a
moz-do-not-send="true"
href="https://instagram.com/redhatinc"
title="instagram"
style="background:url("")
0px 50%/16px no-repeat
transparent;height:20px;color:rgb(119,119,119);display:inline-block;line-height:20px;padding-left:16px"
target="_blank">@redhatinc</a> <a
moz-do-not-send="true"
href="https://snapchat.com/add/redhatsnaps"
title="snapchat"
style="background:url("")
0px 50%/15px no-repeat
transparent;height:20px;color:rgb(119,119,119);display:inline-block;line-height:20px;padding-left:16px"
target="_blank">@red<wbr>hatsnaps</a></div>
</div>
</div>
</div>
</div>
</font></span></font></span></div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
______________________________<wbr>_________________<br>
resteasy-dev mailing list<br>
<a moz-do-not-send="true"
href="mailto:resteasy-dev@lists.jboss.org">resteasy-dev@lists.jboss.org</a><br>
<a moz-do-not-send="true"
href="https://lists.jboss.org/mailman/listinfo/resteasy-dev"
rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/resteasy-dev</a><br>
<br>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
resteasy-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:resteasy-dev@lists.jboss.org">resteasy-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/resteasy-dev">https://lists.jboss.org/mailman/listinfo/resteasy-dev</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
My company's smarter than your company (unless you work for Red Hat)</pre>
</body>
</html>