Hi Laurent,

This isn't correct indeed. I've fixed the behavior and added a test case as
well (see attached) in SVN trunk.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com




-----Message d'origine-----
De : Laurent Rustuel [mailto:laurent.rust...@genesyslab.com] 
Envoyé : mercredi 18 novembre 2009 17:01
À : discuss@restlet.tigris.org
Objet : Validator : not required attribute and fails if not found

Hello,
I have take a look at the new Validator class. Reading the method
beforeHandle(Request request, Response response) I don't can't 
understand why, when an attribute is not required, it return a Status 
CLIENT_ERROR_BAD_REQUEST if the value is not found. But if the value is 
not required, you should not return a client error.

Maybe in the beforeHandle(Request request, Response response) method, 
you should first test if the attribute is required or not, and then test 
accordingly.
I hope I'm clear enough.

Regards,
Laurent.

-- 
Laurent Rustuel,
Alten contractor for Genesys, an Alcatel-Lucent Company

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=24195
72

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2423502

Attachment: ValidatorTestCase.java
Description: Binary data

Reply via email to