You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up to #6714 which (most helpfully, thanks again!) directed us to PR #5728 with which we can generate working R code from our YAML spec. But running the code ends in a runtime error e.g. from here for the access I tried:
deserializedRespObj<- tryCatch(
self$apiClient$deserialize(resp, "ArraySchema", loadNamespace("openapi")),
error=function(e){
stop("Failed to deserialize response")
}
# more code here...
because resp$content is a raw character vector which needs rawToChar(). I injected a step to save the (R-serialized) response object for the simple call.
eddelbuettel
changed the title
[BUG] [R] Code generated needs a 'raw2char' translation before JSON deparsing
[BUG] [R] Code generated needs a 'raw2Char' translation before JSON deparsing
Jun 24, 2020
As a follow-up I since learned that the related / simpler rapiclient package for R and OpenAPI has a hook for a 'handler' function. In a test case I used that to rawToChar() convert the result$content object. We could like do the same here and you may already offer such a hook which I could well have missed....
FWIW I got around this error by using openapitools/openapi-generator-cli:latest instead of openapitools/openapi-generator-cli:v5.3.0. The generated code then ran fine.
Bug Report Checklist
Description
This is a follow-up to #6714 which (most helpfully, thanks again!) directed us to PR #5728 with which we can generate working R code from our YAML spec. But running the code ends in a runtime error e.g. from here for the access I tried:
because
resp$content
is a raw character vector which needsrawToChar()
. I injected a step to save the (R-serialized) response object for the simple call.Our service generally wants a username/password handshake; I will try to take a look at a possible password-less transaction.
openapi-generator version
See PR #5728
OpenAPI declaration file content or url
The YAML file is given above in the snippet and from here:
Command line used for generation
See above. We used your PR to generate an R package from the YAML spec listed above. No further changes.
Steps to reproduce
See above, I followed your recommended invocation.
Related issues/PRs
N/A
Suggest a fix
N/A
The text was updated successfully, but these errors were encountered: