I'd like to indicate that a query parameter is required. There doesn't seem
to be a way to do this using the @QueryParam annotation. Is there a
@Required annotation or something similar that I'm missing?
The behaviour that I would expect is that it would return a 400 response if
the parameter is missing.
I know of two workarounds:
1. use classes (eg Integer instead of int) and check to see if it's null
I don't really want to do this in every method where I have a required field
2. Write a custom parameter class
I don't want to do that for every field type (RequiredInteger,
RequiredString...)
Please let me know if there's a way of requiring a parameter in Jersey.
Thanks,
Dirk
--
View this message in context: http://n2.nabble.com/Required-parameters-on-a-Resource-tp3446928p3446928.html
Sent from the Jersey mailing list archive at Nabble.com.