I'm having below api
@GetMapping(value = "/employees")
public List<Employee> getEmployees(
@RequestParam(value = "mode", required = false) final EmployeeMode mode) {
//calling service from here
}
I'm having EmployeeMode enum as requestParam.
public enum EmployeeMode {
REGULAR,
ALL,
TEMPROARY
}
I want to accept request with case insensitive. Tried with @JsonAlias
, @JsonCreator
and objectMapper.configure(MapperFeature.ACCEPT_CASE_INSENSITIVE_ENUMS, true);
and spring.jackson.mapper.accept-case-insensitive-enums: true
. nothing worked for me.
I'm using spring boot 2.5.5.
How to accept case insensitive request with requestParam? And if requestParam is empty/null, want to set default enum as ALL.