Following the example on the page http://plumber.trestletech.com/
I wrote myfile.R as
#* @post /test
test <- function(){
list(speech='aa',source='bb',displayText='cc')
}
And I ran the plumber code on it to convert int into an API
library(plumber)
r <- plumb("~/Work/myfile.R")
r$run(port=8000)
And Now when I perform an POST request on it using I get
curl -XPOST 'localhost:8000/test
-> {"speech":["aa"],"source":["bb"],"displayText":["cc"]}
But I want the square brackets to be removed. In simple toJSON calls it can be done using auto_unbox=TRUE but how can I do it in plumber. How can I write a custom serializer and use it in the above code?