<div dir="ltr">Following up on [1], currently we give 400 (Bad Request), with no good meaning, when creating/updating a PushApplication or a Variant;<div><br></div><div><br></div><div>The HTML page(!) simply says &quot;The request sent by the client was syntactically incorrect &quot;</div>
<div><br></div><div>As suggested in [1] a good idea is using Bean Validation and returning better errors. </div><div><br></div><div>The result would be a 400 (Bad Request) response, containing the errors and their messages as a JSON object (instead of a HTML page).</div>
<div><br></div><div>E.g.:</div><div><br></div><div>{&quot;name&quot;:&quot;may not be null&quot;}<br></div><div><div><br></div><div>This is a) more meaningful and we can also get rid of our &#39;hard-coded&#39; validation rules, like:</div>
<div><a href="https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/AndroidVariantEndpoint.java#L79-L82">https://github.com/aerogear/aerogear-unifiedpush-server/blob/master/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/applications/AndroidVariantEndpoint.java#L79-L82</a><br>
</div><div><br></div><div>-Matthias</div><div><br></div><div><br></div><div>[1] <a href="https://issues.jboss.org/browse/AGPUSH-255">https://issues.jboss.org/browse/AGPUSH-255</a></div><div><br>-- <br>Matthias Wessendorf <br>
<br>blog: <a href="http://matthiaswessendorf.wordpress.com/" target="_blank">http://matthiaswessendorf.wordpress.com/</a><br>sessions: <a href="http://www.slideshare.net/mwessendorf" target="_blank">http://www.slideshare.net/mwessendorf</a><br>
twitter: <a href="http://twitter.com/mwessendorf" target="_blank">http://twitter.com/mwessendorf</a>
</div></div></div>