Skip to content
This repository has been archived by the owner on May 28, 2018. It is now read-only.

Parameter Validation #623

Open
glassfishrobot opened this issue Aug 18, 2009 · 3 comments
Open

Parameter Validation #623

glassfishrobot opened this issue Aug 18, 2009 · 3 comments

Comments

@glassfishrobot
Copy link

Add more flexible parameter validation to Jersey.

In particular, the solution should at least include the ability to check if a
parameter is present and raise an error if is not.
In general and eventually the solution should allow flexible parameter validation.

Possible solutions:

  1. Jersey supports an @required annotation; or

  2. Exposes a lower-level abstraction of MultivaluedParameterExtractor
    (which is an internally used interface):

public interface MultivaluedParameterExtractor

{ Object extract(MultivaluedMap<String, String> parameters); }

public interface MultivaluedParameterExtractorProvider { }

public interface MultivaluedParameterExtractorWorkers { }

and the same type of pattern can be utilized.

  1. One can utilize AOP method-level interceptors to support @required
    and check for a null value. This solution is much better if one needs to take
    into account more than one value.

I also wonder if there is a more general approach to parameter
validation we can apply with the bean validation framework.

Environment

Operating System: All
Platform: All
URL: http://n2.nabble.com/Required-parameters-on-a-Resource-td3446928.html

@glassfishrobot
Copy link
Author

Reported by [email protected]

@glassfishrobot
Copy link
Author

ccamel said:
This feature will be great.

I think it would be interesting to use a set of annotations derived from JSR-305.

@glassfishrobot
Copy link
Author

This issue was imported from java.net JIRA JERSEY-351

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants