Open ahjota opened 3 years ago
I corrected this issue to reference the fact that super
is a reserved keyword in the R6 OO system, not public
. Additionally, initialize
will also cause runtime issues as this word is reserved for the class initializer... new()
-ing a model generated with the property initialize
will throw the following at runtime:
Error in R6::R6Class("MyObject", public = list(initialize = NULL, initialize = function(initialize = NULL, :
All items in public, private, and active must have unique names.
Bug Report Checklist
Description
Generating the R client for a spec that has a model with property named one of
self
,private
, orsuper
creates code with runtime errors.Additionally, using
initialize
will cause a different error:In the R6 OO system,
self
,private
, andsuper
are used to access public members / private members / superclass methods.initialize
is the class initializer.https://r6.r-lib.org/articles/Introduction.html#fields-containing-reference-objects-1
openapi-generator version
I am using openapi-generator 5.1.1.
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Prereq: R and RStudio installed
rtest
output directory. This will create an .Rproj file inrtest
.devtools::load_all()
to load the library.Related issues/PRs
Suggest a fix
initialize
,super
,private
, andself
as reserved keywordsI've created a gist with a generated model file that is broken as well as what I think the expected file should look like.
I'm guessing this means changes to all of the model* templates.