-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[R] Enum R6Class Support, closes #3367 #5728
Conversation
Hi William, @wing328 |
Sorry too busy. @Ramanth I wonder if you can review this PR when you've time. Thank you. |
Thanks Will. |
UPDATE: I've merged the latest master of the official repo into your branch. Let's see if that fixes the CircleCI, Travis CI build failures. |
CircleCI reports the following errors:
I wonder if you can take a look when you've time. |
For the Travis CI failure, I really have no clue as I don't see any changes to the python samples:
|
- export tag does not coincide with original model function - move helper down so it does
Hi Will, @wing328 Thank you for taking a look at it. The enum functionality did not introduce any additional tests. I can look into why As a side note, based on what I have seen in the original implementation, I wouldn't |
Hi Will, @wing328 I noticed that when running Should overwriting be the default when generating the R client SDK? Perhaps, we could Thanks, |
Something like: diff --git a/bin/r-petstore.sh b/bin/r-petstore.sh
index 4decf28f72..abb7095109 100755
--- a/bin/r-petstore.sh
+++ b/bin/r-petstore.sh
@@ -25,8 +25,14 @@ then
mvn -B clean package
fi
+PET_PKG="samples/client/petstore/R"
+
+if [ -d "${PET_PKG}" ]; then
+ rm -rf ${PET_PKG}
+fi
+
# if you've executed sbt assembly previously it will use that instead.
export JAVA_OPTS="${JAVA_OPTS} -Xmx1024M -DloggerPath=conf/log4j.properties"
-ags="generate -t modules/openapi-generator/src/main/resources/r -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g r -o samples/client/petstore/R --additional-properties packageName=petstore $@"
+ags="generate -t modules/openapi-generator/src/main/resources/r -i modules/openapi-generator/src/test/resources/2_0/petstore.yaml -g r -o ${PET_PKG} --additional-properties packageName=petstore $@"
java $JAVA_OPTS -jar $executable $ags
|
That's by design as users may have manually written some tests. Can you please restore those tests and update the tests to make it work with enum enhancement in this PR instead? |
This reverts commit b6314c8.
- preserve test_petstore.R
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I've not tested it locally.
@LiNk-NY thanks for the contribution, which has been merged into master. |
* master: (142 commits) update python samples clarify direction of py client side validation flag (#6850) fix erronous cmd arg example for docker in readme (#6846) [BUG] [JAVA] Fix multiple files upload (#4803) (#6808) [kotlin][client] fix retrofit dependencies (#6836) [PowerShell] add more fields to be customized (#6835) [Java][WebClient]remove the dead code from java ApiClient.mustache (#6556) [PHP] Better handling of invalid data (array) (#6760) Make ApiClient in retrofit2 be able to use own OkHttpClient (#6699) mark python2 support in flask as deprecated (#6653) update samples [Java][jersey2] Add a getter for the User-Agent header value (#6831) Provides a default nil value for optional init parameters (#6827) [Java] Deprecate feignVersion option (#6824) [R] Enum R6Class Support, closes #3367 (#5728) [Rust][Client] Unify sync/async client structure (#6753) [php-ze-ph] Set required PHP version to ^7.2 (#6763) [Java][client][native][Gradle] Add missing jackson-databind-nullable (#6802) Improve sttpOpenApiClient generator (#6684) Update docker-tag-latest-release.yml ...
Hi all,
We've (@mtmorgan, @dvantwisk) provided an R6 class based on guidelines in issue #3367.
This PR includes:
modelEnum.mustache
fromJSONString
,fromJSON
, etc.function(, ...)
tofunction(...)
httr::content(resp)
instead ofapiResponse$content
./bin/r-petstore.sh
Diff of the changes: master...LiNk-NY:enum
Example implementation from the HCAMatrix Service:
PR checklist
./bin/
(or Windows batch scripts under.\bin\windows
) to update Petstore samples related to your fix. This is important, as CI jobs will verify all generator outputs of your HEAD commit, and these must match the expectations made by your contribution. You only need to run./bin/{LANG}-petstore.sh
,./bin/openapi3/{LANG}-petstore.sh
if updating the code or mustache templates for a language ({LANG}
) (e.g. php, ruby, python, etc).master
,4.3.x
,5.0.x
. Default:master
.Best regards,
Marcel
cc @Leo-Rutschmann @wing328 @ramnov
To close #3367