OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
However, the line status_object <- ProjectRunStatus$new() fails because the class for the enumerated value cannot be initialized without a value:
initialize = function(...) {
local.optional.var <- list(...)
val <- unlist(local.optional.var)
enumvec <- .parse_ProjectRunStatus()
stopifnot(length(val) == 1L)
if (!val %in% enumvec)
stop("Use one of the valid values: ",
paste0(enumvec, collapse = ", "))
private$value <- val
},
openapi-generator version
6.1.0
Generation Details
yarn run openapi-generator-cli generate -i ./generated/openapi.json -o ../../r-sdk --package-name hexApi -g r
Steps to reproduce
See Above
Related issues/PRs
Suggest a fix
I'm not too familiar with classes in R, so I'm not certain, but somehow the code should somehow be updated to not try to instantiate an empty enum class.
Bug Report Checklist
Description
When a response payload contains an enum value, the R generator seems to produce unusable code.
The code to generate response payload from JSON ends up looking like this:
However, the line
status_object <- ProjectRunStatus$new()
fails because the class for the enumerated value cannot be initialized without a value:openapi-generator version
6.1.0
Generation Details
yarn run openapi-generator-cli generate -i ./generated/openapi.json -o ../../r-sdk --package-name hexApi -g r
Steps to reproduce
See Above
Related issues/PRs
Suggest a fix
I'm not too familiar with classes in R, so I'm not certain, but somehow the code should somehow be updated to not try to instantiate an empty enum class.