So, I got into this new Spring Boot project which was already under developement and while writing API's I used Enum
for @RequestParam
in my controller and it worked.
I did not write any converters for this.
Later on I noticed that in this project the other developers had written custom Converter's for this.
So I decided to search the web regarding this and all solutions that came up for using Enum
with Controller
in Spring Boot used converter, could not find any examples without converter like how I did.
Below is one an example of how I wrote this, LoanStatus
is an Enum
:
@RequestMapping(value = "/loans", method = RequestMethod.GET)
public ResponseEntity<?> getPatientsLoan(HttpServletRequest request,
@RequestParam(value = "loanStatus", required = false) LoanStatus loanStatus) {}
So is this a relatively new feature that Spring Boot accepts Enums
now without the need for converter's and that is why all the examples used converters or will I face some issue in feature cause I did not user converter's even though it is currently working for me?