When using the library to convert an HTTP request into an R code snippet, parameters with special characters (such as codes[]
or demo-param
) are not being quoted correctly in the generated R code. This causes an error in R because such parameters are not valid without quotes.
In R, certain special characters like []
, -
, and others are not valid in unquoted object names. As a result, the generated R code fails to execute properly when using such parameters.
I also saw a test case at "https://github.com/Kong/httpsnippet/blob/master/src/targets/r/httr/fixtures/nested.r" which doesn't run in R,
it gives following error
Error: unexpected '=' in:
"queryString <- list(
foo[bar] ="
Execution halted
Instead it should be like this to run correctly and avoid any special character issues.
queryString <- list(
`foo[bar]` = "baz,zap",
`fiz` = "buz"
)