From 7391a777124034d4459314f261b16b6e80ec1bb1 Mon Sep 17 00:00:00 2001
From: Ramanth <addalaramanth@gmail.com>
Date: Mon, 18 May 2020 14:58:21 +0530
Subject: [PATCH 1/3] replacing caTools dependency with base64enc

---
 modules/openapi-generator/src/main/resources/r/api.mustache   | 4 ++--
 .../src/main/resources/r/description.mustache                 | 2 +-
 samples/client/petstore/R/DESCRIPTION                         | 2 +-
 samples/client/petstore/R/R/pet_api.R                         | 2 +-
 samples/client/petstore/R/R/store_api.R                       | 2 +-
 samples/client/petstore/R/R/user_api.R                        | 2 +-
 6 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/modules/openapi-generator/src/main/resources/r/api.mustache b/modules/openapi-generator/src/main/resources/r/api.mustache
index 2fd462e1378..b3057454cdb 100644
--- a/modules/openapi-generator/src/main/resources/r/api.mustache
+++ b/modules/openapi-generator/src/main/resources/r/api.mustache
@@ -141,7 +141,7 @@
 {{/operation}}
 #' }
 #' @importFrom R6 R6Class
-#' @importFrom caTools base64encode
+#' @importFrom base64enc base64encode
 {{#useRlangExceptionHandling}}
 #' @importFrom rlang abort
 {{/useRlangExceptionHandling}}
@@ -239,7 +239,7 @@
       {{#isBasic}}
       {{#isBasicBasic}}
       # HTTP basic auth
-      headerParams['Authorization'] <- paste("Basic", caTools::base64encode(paste(self$apiClient$username, self$apiClient$password, sep=":")), sep=" ")
+      headerParams['Authorization'] <- paste("Basic", base64enc::base64encode(charToRaw(paste(self$apiClient$username, self$apiClient$password, sep=":"))))
       {{/isBasicBasic}}
       {{/isBasic}}
       {{#isApiKey}}
diff --git a/modules/openapi-generator/src/main/resources/r/description.mustache b/modules/openapi-generator/src/main/resources/r/description.mustache
index 3bd9db79ee4..d4e01ac751b 100644
--- a/modules/openapi-generator/src/main/resources/r/description.mustache
+++ b/modules/openapi-generator/src/main/resources/r/description.mustache
@@ -10,5 +10,5 @@ Encoding: UTF-8
 License: {{#licenseInfo}}{{licenseInfo}}{{/licenseInfo}}{{^licenseInfo}}Unlicense{{/licenseInfo}}
 LazyData: true
 Suggests: testthat
-Imports: jsonlite, httr, R6, caTools{{#useRlangExceptionHandling}}, rlang{{/useRlangExceptionHandling}}
+Imports: jsonlite, httr, R6, base64enc{{#useRlangExceptionHandling}}, rlang{{/useRlangExceptionHandling}}
 RoxygenNote: 6.0.1.9000
diff --git a/samples/client/petstore/R/DESCRIPTION b/samples/client/petstore/R/DESCRIPTION
index 481820f8457..985a6e7b131 100644
--- a/samples/client/petstore/R/DESCRIPTION
+++ b/samples/client/petstore/R/DESCRIPTION
@@ -10,5 +10,5 @@ Encoding: UTF-8
 License: Apache-2.0
 LazyData: true
 Suggests: testthat
-Imports: jsonlite, httr, R6, caTools
+Imports: jsonlite, httr, R6, base64enc
 RoxygenNote: 6.0.1.9000
diff --git a/samples/client/petstore/R/R/pet_api.R b/samples/client/petstore/R/R/pet_api.R
index 9fad358f4f9..3940dca6bf8 100644
--- a/samples/client/petstore/R/R/pet_api.R
+++ b/samples/client/petstore/R/R/pet_api.R
@@ -317,7 +317,7 @@
 #'
 #' }
 #' @importFrom R6 R6Class
-#' @importFrom caTools base64encode
+#' @importFrom base64enc base64encode
 #' @export
 PetApi <- R6::R6Class(
   'PetApi',
diff --git a/samples/client/petstore/R/R/store_api.R b/samples/client/petstore/R/R/store_api.R
index ba525799db5..7145e5b09f4 100644
--- a/samples/client/petstore/R/R/store_api.R
+++ b/samples/client/petstore/R/R/store_api.R
@@ -160,7 +160,7 @@
 #'
 #' }
 #' @importFrom R6 R6Class
-#' @importFrom caTools base64encode
+#' @importFrom base64enc base64encode
 #' @export
 StoreApi <- R6::R6Class(
   'StoreApi',
diff --git a/samples/client/petstore/R/R/user_api.R b/samples/client/petstore/R/R/user_api.R
index 4c4afbeb72b..1a6b13363aa 100644
--- a/samples/client/petstore/R/R/user_api.R
+++ b/samples/client/petstore/R/R/user_api.R
@@ -277,7 +277,7 @@
 #'
 #' }
 #' @importFrom R6 R6Class
-#' @importFrom caTools base64encode
+#' @importFrom base64enc base64encode
 #' @export
 UserApi <- R6::R6Class(
   'UserApi',
-- 
GitLab


From 7e596e422906574a03131a8c1d26830b52ae4473 Mon Sep 17 00:00:00 2001
From: Ramanth <addalaramanth@gmail.com>
Date: Mon, 18 May 2020 16:42:08 +0530
Subject: [PATCH 2/3] adding review fixes

---
 modules/openapi-generator/src/main/resources/r/README.mustache | 2 +-
 samples/client/petstore/R/README.md                            | 2 +-
 samples/client/petstore/R/test_petstore.bash                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/openapi-generator/src/main/resources/r/README.mustache b/modules/openapi-generator/src/main/resources/r/README.mustache
index 5ea73921859..718fddaac3e 100644
--- a/modules/openapi-generator/src/main/resources/r/README.mustache
+++ b/modules/openapi-generator/src/main/resources/r/README.mustache
@@ -26,7 +26,7 @@ Install the dependencies
 ```R
 install.packages("jsonlite")
 install.packages("httr")
-install.packages("caTools")
+install.packages("base64enc")
 ```
 
 ### Build the package
diff --git a/samples/client/petstore/R/README.md b/samples/client/petstore/R/README.md
index bdff66e39bc..c0a42298c37 100644
--- a/samples/client/petstore/R/README.md
+++ b/samples/client/petstore/R/README.md
@@ -18,7 +18,7 @@ Install the dependencies
 ```R
 install.packages("jsonlite")
 install.packages("httr")
-install.packages("caTools")
+install.packages("base64enc")
 ```
 
 ### Build the package
diff --git a/samples/client/petstore/R/test_petstore.bash b/samples/client/petstore/R/test_petstore.bash
index ad0b3a6aa19..ba104d859e0 100644
--- a/samples/client/petstore/R/test_petstore.bash
+++ b/samples/client/petstore/R/test_petstore.bash
@@ -14,7 +14,7 @@ Rscript -e "install.packages('jsonlite', repos='$REPO', lib='$R_LIBS_USER')"
 Rscript -e "install.packages('httr', repos='$REPO', lib='$R_LIBS_USER')"
 Rscript -e "install.packages('testthat', repos='$REPO', lib='$R_LIBS_USER')"
 Rscript -e "install.packages('R6', repos='$REPO', lib='$R_LIBS_USER')"
-Rscript -e "install.packages('caTools', repos='$REPO', lib='$R_LIBS_USER')"
+Rscript -e "install.packages('base64enc', repos='$REPO', lib='$R_LIBS_USER')"
 Rscript -e "install.packages('rlang', repos='$REPO', lib='$R_LIBS_USER')"
 
 R CMD build .
-- 
GitLab


From e4f7d4b709be83cbcb9851cdd02279933f1fa63a Mon Sep 17 00:00:00 2001
From: Veda Bhaskara Ramanth Addala <vedabhaskararamanth.addala@factset.com>
Date: Wed, 20 May 2020 16:21:01 +0530
Subject: [PATCH 3/3] fix(r) : updated the cran repo url

---
 samples/client/petstore/R/test_petstore.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/samples/client/petstore/R/test_petstore.bash b/samples/client/petstore/R/test_petstore.bash
index ba104d859e0..65f16e65404 100644
--- a/samples/client/petstore/R/test_petstore.bash
+++ b/samples/client/petstore/R/test_petstore.bash
@@ -2,7 +2,7 @@
 
 set -e
 
-REPO=http://cran.revolutionanalytics.com
+REPO=https://cloud.r-project.org
 
 export R_LIBS_USER=$HOME/R
 
-- 
GitLab