<div dir="ltr">Hi Gunnar,<div><br></div><div>I will open a BVAL issue. Interesting the n option, but I didn&#39;t find any concrete use case neither. As you said, usually the result expected is true or false.</div><div><br></div><div>Cheers</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 30, 2016 at 10:42 AM, Emmanuel Bernard <span dir="ltr">&lt;<a href="mailto:emmanuel@hibernate.org" target="_blank">emmanuel@hibernate.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I don&#39;t think a n option would make sense.<br>
One that might make sense is to keep validating a failing field with the<br>
remaining constraints before stopping to at least have a comprehensive<br>
view of the failure especially when constraints are composed.<br>
<span class="HOEnZb"><font color="#888888"><br>
Emmanuel<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Tue 2016-08-30  8:48, Gunnar Morling wrote:<br>
&gt; Hi Marco,<br>
&gt;<br>
&gt; Thanks for bringing up this proposal. I think it&#39;d be a good addition. Can<br>
&gt; you open a BVAL issue for it?<br>
&gt;<br>
&gt; A variation could be to not stop after the first failure but after the<br>
&gt; first n, with n being a configurable number. I can&#39;t see a compelling use<br>
&gt; case for this, though. Usually you just want a quick exit if an object is<br>
&gt; invalid, so a binary setting should do it.<br>
&gt;<br>
&gt; @Others, any thoughts from your side?<br>
&gt;<br>
&gt; Cheers,<br>
&gt;<br>
&gt; --Gunnar<br>
&gt;<br>
&gt;<br>
&gt; 2016-08-29 7:38 GMT+02:00 Marco Molteni &lt;<a href="mailto:moltenma@gmail.com">moltenma@gmail.com</a>&gt;:<br>
&gt;<br>
&gt; &gt; Hi guys,<br>
&gt; &gt;<br>
&gt; &gt; What do you think about the &#39;promotion&#39; of fail-fast (from hibernate<br>
&gt; &gt; validator) to the BV API?<br>
&gt; &gt;<br>
&gt; &gt; I see frequently this 2 use cases (in the 9-5 projects) to support the<br>
&gt; &gt; request ;)<br>
&gt; &gt;<br>
&gt; &gt; 1. batch: there are a lot of batch processes that have to validate the<br>
&gt; &gt; input data (flat file -&gt; bean -&gt; validation) and return for each bean only<br>
&gt; &gt; a technical error if at least one field is not valid (&#39;input refused&#39;).<br>
&gt; &gt; When there are millions (e.g. payments transactions) of beans to validate<br>
&gt; &gt; in a batch and 30-50 fields for each bean the fail-fast saves a lot of time<br>
&gt; &gt; (and the night is never long enough for all the batches required) ;)<br>
&gt; &gt;<br>
&gt; &gt; 2. REST response: in the validation of REST services often when 2 systems<br>
&gt; &gt; exchange data the answer in case of error is an HTTP 4xx without many<br>
&gt; &gt; details. The fail-fast is a time and machine resources saving when your<br>
&gt; &gt; application is accessed by (hundred of) thousand users through some<br>
&gt; &gt; external web client (e.g. JS client).<br>
&gt; &gt;<br>
&gt; &gt; In the do-it-yourself implementations for the 2 uses cases at the first<br>
&gt; &gt; error an IllegalArgumentException is thrown with the information of the<br>
&gt; &gt; first error found.<br>
&gt; &gt;<br>
&gt; &gt; The full test of every field is very well suited for uses cases in which<br>
&gt; &gt; there is a human to machine communication (e.g. web forms).<br>
&gt; &gt;<br>
&gt; &gt; If your opinion is positive I can do more investigations if needed.<br>
&gt; &gt;<br>
&gt; &gt; Cheers<br>
&gt; &gt;<br>
&gt; &gt; Marco<br>
&gt; &gt;<br>
&gt; &gt; ______________________________<wbr>_________________<br>
&gt; &gt; beanvalidation-dev mailing list<br>
&gt; &gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
&gt; &gt;<br>
<br>
&gt; ______________________________<wbr>_________________<br>
&gt; beanvalidation-dev mailing list<br>
&gt; <a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
<br>
______________________________<wbr>_________________<br>
beanvalidation-dev mailing list<br>
<a href="mailto:beanvalidation-dev@lists.jboss.org">beanvalidation-dev@lists.<wbr>jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/beanvalidation-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/<wbr>beanvalidation-dev</a><br>
</div></div></blockquote></div><br></div>