I have a method that uses a FormParam
parameter anotation and the parameter itself is a collection of String
, Like this:
public void sendEmail(
@FormParam("recipients") List<String> recipients,
...
The data I send is like this:
recipients:["test.test@mail.com", "test2.test2@mail.com"]
subject:Test Email
body:Test email
The strange thing is that the recipents list contains only one element that is a string of the concatenated items. From the answer to this question https://stackoverflow.com/a/18716400/3719857 this seems to be the expected behaviour. Which in my opinion is horrible. I can always parse the data, but that is not ok. Is there some way to get the actual strings and not their concatenation. Something like an additional annotation or maybe some generic converter. Any help is welcomed.