Dependent RequestParam validation in Spring boot

131 Views Asked by At

I have a scenario where I have to rename one required request param. My application is already live. I want to deprecate the existing request param and want to add new request parameter. So my existing applications will be sending me the old request parameter and new application will start to send the new param. Now I want to add validation, either I can mark both params as required or optional. But my business logic is either of param is required.

For example I already have a path parameter group and now I want to rename it to pageGroup. So either page or pageGroup is required.

How can I achieve it in Spring Boot? Any suggestions are welcome :)

0

There are 0 best solutions below