I have POJO class that represents list of request params.
Currently it uses field names, but I need to set them to kebab-case naming.
For example: List<Product> productIds = new ArrayList<>()
should accept request param product-ids
instead of productIds
.
Using directly @RequestParam
I can do @RequestParam(name="product-ids")
, but I need it using binded POJO.
@JsonProperty
or @JsonNaming(KebabCaseStrategy.class)
don't work on that fields, I think because it's not a serialiazable object, but just a request param container.
Examples in How to customize parameter names when binding Spring MVC command objects? dont work for me.
Exception:
| paramNameProcessor (field private org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter com.example.jpastudy.config.ParamNameProcessor.requestMappingHandlerAdapter)
↑ ↓
| requestMappingHandlerAdapter defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]
└─────┘
How could I resolve that?