Quantcast
Viewing all articles
Browse latest Browse all 3683

Spring REST - At least one RequestParameter mandatory

I have a method with below RequestMappings:

@RequestParam(value = "someValue1", required = false) final String someValue1@RequestParam(value = "someValue2", required = false) final String someValue2

Both the parameters are marked as optional. And currently I check which attribute is provided and based on that some action is taken. Is it possible to enforce at least one of the two parameters should always be present in the request?

PS: I am not looking at creating two different end points.


Viewing all articles
Browse latest Browse all 3683

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>