Skip to content

Improve parameter validation #48

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
thboileau opened this issue Mar 7, 2012 · 1 comment
Open

Improve parameter validation #48

thboileau opened this issue Mar 7, 2012 · 1 comment

Comments

@thboileau
Copy link
Contributor

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

@ghost ghost assigned jlouvel Mar 7, 2012
@jlouvel
Copy link
Collaborator

jlouvel commented Apr 12, 2014

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:

  • current routing provides validation of the resource URI -> 404 Not Found
  • the application should be able to easily restore the client view for correction if validation fails
  • keep the design centered on the Resource class, target of the request, especially for request entity validation.
  • the Handler class or a new Validator filter could enforce some additional validation rules, like the presence and format of some attributes, and allow custom error entities to be returned.

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

@jlouvel jlouvel modified the milestone: Unplanned Nov 2, 2014
@jlouvel jlouvel modified the milestone: Unplanned Dec 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants