Skip to content

Commit 1d7111f

Browse files
committed
update petstore
1 parent a4aac2a commit 1d7111f

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

samples/client/petstore/R-httr2-wrapper/R/fake_api.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ FakeApi <- R6::R6Class(
561561
reason = "Missing required parameter `reg_exp_test`."))
562562
}
563563

564-
if (!str_detect(`reg_exp_test`, "^[A-Za-z0-9_]{1,15}$")) {
564+
if (!is.null(`reg_exp_test`) && !stringr::str_detect(`reg_exp_test`, "^[A-Za-z0-9_]{1,15}$")) {
565565
rlang::abort(message = "Invalid value for `reg_exp_test` when calling FakeApi$fake_regular_expression, must conform to the pattern ^[A-Za-z0-9_]{1,15}$.",
566566
.subclass = "ApiException",
567567
ApiException = ApiException$new(status = 0,
@@ -678,7 +678,7 @@ FakeApi <- R6::R6Class(
678678

679679

680680
# check if items are unique
681-
if (!identical(`set_dummy`, unique(`set_dummy`))) {
681+
if (!is.null(`set_dummy`) && !identical(`set_dummy`, unique(`set_dummy`))) {
682682
rlang::abort(message = "Invalid value for `set_dummy` when calling FakeApi$fake_set_query. Items must be unique.",
683683
.subclass = "ApiException",
684684
ApiException = ApiException$new(status = 0,

samples/client/petstore/R-httr2-wrapper/R/store_api.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,13 @@ StoreApi <- R6::R6Class(
414414
reason = "Missing required parameter `order_id`."))
415415
}
416416

417-
if (`order_id` > 5) {
417+
if (!is.null(`order_id`) && `order_id` > 5) {
418418
rlang::abort(message = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be smaller than or equal to 5.",
419419
.subclass = "ApiException",
420420
ApiException = ApiException$new(status = 0,
421421
reason = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be smaller than or equal to 5."))
422422
}
423-
if (`order_id` < 1) {
423+
if (!is.null(`order_id`) && `order_id` < 1) {
424424
rlang::abort(message = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be bigger than or equal to 1.",
425425
.subclass = "ApiException",
426426
ApiException = ApiException$new(status = 0,

samples/client/petstore/R-httr2-wrapper/R/user_api.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ UserApi <- R6::R6Class(
873873
reason = "Missing required parameter `password`."))
874874
}
875875

876-
if (!str_detect(`username`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
876+
if (!is.null(`username`) && !stringr::str_detect(`username`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
877877
rlang::abort(message = "Invalid value for `username` when calling UserApi$login_user, must conform to the pattern ^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$.",
878878
.subclass = "ApiException",
879879
ApiException = ApiException$new(status = 0,

samples/client/petstore/R-httr2/R/fake_api.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ FakeApi <- R6::R6Class(
561561
reason = "Missing required parameter `reg_exp_test`."))
562562
}
563563

564-
if (!str_detect(`reg_exp_test`, "^[A-Za-z0-9_]{1,15}$")) {
564+
if (!is.null(`reg_exp_test`) && !stringr::str_detect(`reg_exp_test`, "^[A-Za-z0-9_]{1,15}$")) {
565565
rlang::abort(message = "Invalid value for `reg_exp_test` when calling FakeApi$fake_regular_expression, must conform to the pattern ^[A-Za-z0-9_]{1,15}$.",
566566
.subclass = "ApiException",
567567
ApiException = ApiException$new(status = 0,
@@ -678,7 +678,7 @@ FakeApi <- R6::R6Class(
678678

679679

680680
# check if items are unique
681-
if (!identical(`set_dummy`, unique(`set_dummy`))) {
681+
if (!is.null(`set_dummy`) && !identical(`set_dummy`, unique(`set_dummy`))) {
682682
rlang::abort(message = "Invalid value for `set_dummy` when calling FakeApi$fake_set_query. Items must be unique.",
683683
.subclass = "ApiException",
684684
ApiException = ApiException$new(status = 0,

samples/client/petstore/R-httr2/R/store_api.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,13 @@ StoreApi <- R6::R6Class(
414414
reason = "Missing required parameter `order_id`."))
415415
}
416416

417-
if (`order_id` > 5) {
417+
if (!is.null(`order_id`) && `order_id` > 5) {
418418
rlang::abort(message = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be smaller than or equal to 5.",
419419
.subclass = "ApiException",
420420
ApiException = ApiException$new(status = 0,
421421
reason = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be smaller than or equal to 5."))
422422
}
423-
if (`order_id` < 1) {
423+
if (!is.null(`order_id`) && `order_id` < 1) {
424424
rlang::abort(message = "Invalid value for `order_id` when calling StoreApi$get_order_by_id, must be bigger than or equal to 1.",
425425
.subclass = "ApiException",
426426
ApiException = ApiException$new(status = 0,

samples/client/petstore/R-httr2/R/user_api.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ UserApi <- R6::R6Class(
873873
reason = "Missing required parameter `password`."))
874874
}
875875

876-
if (!str_detect(`username`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
876+
if (!is.null(`username`) && !stringr::str_detect(`username`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
877877
rlang::abort(message = "Invalid value for `username` when calling UserApi$login_user, must conform to the pattern ^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$.",
878878
.subclass = "ApiException",
879879
ApiException = ApiException$new(status = 0,

samples/client/petstore/R/R/fake_api.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ FakeApi <- R6::R6Class(
561561
reason = "Missing required parameter `reg_exp_test`."))
562562
}
563563

564-
if (!str_detect(`reg_exp_test`, "^[A-Za-z0-9_]{1,15}$")) {
564+
if (!is.null(`reg_exp_test`) && !stringr::str_detect(`reg_exp_test`, "^[A-Za-z0-9_]{1,15}$")) {
565565
rlang::abort(message = "Invalid value for `reg_exp_test` when calling FakeApi$FakeRegularExpression, must conform to the pattern ^[A-Za-z0-9_]{1,15}$.",
566566
.subclass = "ApiException",
567567
ApiException = ApiException$new(status = 0,
@@ -678,7 +678,7 @@ FakeApi <- R6::R6Class(
678678

679679

680680
# check if items are unique
681-
if (!identical(`set_dummy`, unique(`set_dummy`))) {
681+
if (!is.null(`set_dummy`) && !identical(`set_dummy`, unique(`set_dummy`))) {
682682
rlang::abort(message = "Invalid value for `set_dummy` when calling FakeApi$FakeSetQuery. Items must be unique.",
683683
.subclass = "ApiException",
684684
ApiException = ApiException$new(status = 0,

samples/client/petstore/R/R/store_api.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,13 +414,13 @@ StoreApi <- R6::R6Class(
414414
reason = "Missing required parameter `order_id`."))
415415
}
416416

417-
if (`order_id` > 5) {
417+
if (!is.null(`order_id`) && `order_id` > 5) {
418418
rlang::abort(message = "Invalid value for `order_id` when calling StoreApi$GetOrderById, must be smaller than or equal to 5.",
419419
.subclass = "ApiException",
420420
ApiException = ApiException$new(status = 0,
421421
reason = "Invalid value for `order_id` when calling StoreApi$GetOrderById, must be smaller than or equal to 5."))
422422
}
423-
if (`order_id` < 1) {
423+
if (!is.null(`order_id`) && `order_id` < 1) {
424424
rlang::abort(message = "Invalid value for `order_id` when calling StoreApi$GetOrderById, must be bigger than or equal to 1.",
425425
.subclass = "ApiException",
426426
ApiException = ApiException$new(status = 0,

samples/client/petstore/R/R/user_api.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,7 +873,7 @@ UserApi <- R6::R6Class(
873873
reason = "Missing required parameter `password`."))
874874
}
875875

876-
if (!str_detect(`username`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
876+
if (!is.null(`username`) && !stringr::str_detect(`username`, "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$")) {
877877
rlang::abort(message = "Invalid value for `username` when calling UserApi$LoginUser, must conform to the pattern ^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$.",
878878
.subclass = "ApiException",
879879
ApiException = ApiException$new(status = 0,

0 commit comments

Comments
 (0)