restlet / restlet-framework-java

The first REST API framework for Java
https://restlet.talend.com
Other
654 stars 284 forks source link

Improve parameter validation #48

Open thboileau opened 12 years ago

thboileau commented 12 years ago

Initial ticket : http://restlet.tigris.org/issues/show_bug.cgi?id=221

jlouvel commented 10 years ago

From original ticket:

Nic Pottier sent a detailled and interesting feed-back to the list on 15 Dec 2006. We should review the API for potential improvements in the area of parameter extraction and validation.

Some pointers given by Thierry Boileau:

Other pointers:

Some thoughts:

Interesting blog post saying that validation is preferable in the domain model than in the view as it makes it more reusable:

I have added a Route.validateAttribute() method to validate the presence of an attribute and the format of its value.

Paul J. Lucas has proposed a DTO class to handle validation: http://restlet.tigris.org/servlets/BrowseList?list=discuss&by=thread&from=671986