Bug Report Checklist
Description
The generated echo_api client for R breaks out of the box because of invalid R syntax:
|
initialize = function(`id` = NULL, `outcomes` = [SUCCESS, FAILURE], `suffix` = NULL, `text` = NULL, `date` = NULL, ...) { |
The = [SUCCESS, FAILURE] has the appearance of Python code that has snuck in.
openapi-generator version
This is found in the master branch and is an issue in generated integration test code, not an issue found actually running the generator.
OpenAPI declaration file content or url
NA; this is an integration test bug
Generation Details
NA; this is an integration test bug
Steps to reproduce
Navigating to samples/client/echo_api/r, trying to load the package or run tests fails because of the syntax error:
r % Rscript -e 'devtools::test()'
ℹ Testing openapi
Error in `load_all()`:
! Failed to load R/data_query.R
Caused by error in `parse()`:
! At R/data_query.R:37:53: unexpected '['
36: #' @param ... Other optional arguments.
37: initialize = function(`id` = NULL, `outcomes` = [
Related issues/PRs
Not found
Suggest a fix
I am not quite sure what template source is responsible for this errant R code. According to
|
templateDir: modules/openapi-generator/src/main/resources/r |
this uses the same template as the working petstore R client tests; however, the latter three all use settings
exceptionPackage: rlang
useRlangExceptionHandling: true
returnExceptionOnFailure: true
do to which they are following a quite different code generation path that might bypass wherever the issue is. I don't see SUCCESS or FAILURE anywhere in that template directory so I couldn't trace it back any further than that.
Bug Report Checklist
Description
The generated
echo_apiclient forRbreaks out of the box because of invalid R syntax:openapi-generator/samples/client/echo_api/r/R/data_query.R
Line 37 in 4242641
The
= [SUCCESS, FAILURE]has the appearance of Python code that has snuck in.openapi-generator version
This is found in the
masterbranch and is an issue in generated integration test code, not an issue found actually running the generator.OpenAPI declaration file content or url
NA; this is an integration test bug
Generation Details
NA; this is an integration test bug
Steps to reproduce
Navigating to
samples/client/echo_api/r, trying to load the package or run tests fails because of the syntax error:Related issues/PRs
Not found
Suggest a fix
I am not quite sure what template source is responsible for this errant R code. According to
openapi-generator/bin/configs/r-echo-api.yaml
Line 4 in 4242641
this uses the same template as the working petstore R client tests; however, the latter three all use settings
do to which they are following a quite different code generation path that might bypass wherever the issue is. I don't see
SUCCESSorFAILUREanywhere in that template directory so I couldn't trace it back any further than that.