mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-06 10:35:25 +00:00
[R] url-encode path parameters (#2397)
* url encode path parameter * convert number to string before encoding
This commit is contained in:
parent
065bbc7bdb
commit
5ba35ecd31
@ -78,7 +78,7 @@
|
||||
{{#hasPathParams}}
|
||||
{{#pathParams}}
|
||||
if (!missing(`{{paramName}}`)) {
|
||||
urlPath <- gsub(paste0("\\{", "{{baseName}}", "\\}"), `{{paramName}}`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "{{baseName}}", "\\}"), URLencode(as.character(`{{paramName}}`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
{{/pathParams}}
|
||||
|
@ -104,7 +104,7 @@ PetApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/pet/{petId}"
|
||||
if (!missing(`pet.id`)) {
|
||||
urlPath <- gsub(paste0("\\{", "petId", "\\}"), `pet.id`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "petId", "\\}"), URLencode(as.character(`pet.id`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
# OAuth token
|
||||
@ -199,7 +199,7 @@ PetApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/pet/{petId}"
|
||||
if (!missing(`pet.id`)) {
|
||||
urlPath <- gsub(paste0("\\{", "petId", "\\}"), `pet.id`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "petId", "\\}"), URLencode(as.character(`pet.id`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
# API key authentication
|
||||
@ -274,7 +274,7 @@ PetApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/pet/{petId}"
|
||||
if (!missing(`pet.id`)) {
|
||||
urlPath <- gsub(paste0("\\{", "petId", "\\}"), `pet.id`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "petId", "\\}"), URLencode(as.character(`pet.id`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
# OAuth token
|
||||
@ -312,7 +312,7 @@ PetApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/pet/{petId}/uploadImage"
|
||||
if (!missing(`pet.id`)) {
|
||||
urlPath <- gsub(paste0("\\{", "petId", "\\}"), `pet.id`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "petId", "\\}"), URLencode(as.character(`pet.id`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
# OAuth token
|
||||
|
@ -55,7 +55,7 @@ StoreApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/store/order/{orderId}"
|
||||
if (!missing(`order.id`)) {
|
||||
urlPath <- gsub(paste0("\\{", "orderId", "\\}"), `order.id`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "orderId", "\\}"), URLencode(as.character(`order.id`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ StoreApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/store/order/{orderId}"
|
||||
if (!missing(`order.id`)) {
|
||||
urlPath <- gsub(paste0("\\{", "orderId", "\\}"), `order.id`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "orderId", "\\}"), URLencode(as.character(`order.id`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
|
||||
|
@ -166,7 +166,7 @@ UserApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/user/{username}"
|
||||
if (!missing(`username`)) {
|
||||
urlPath <- gsub(paste0("\\{", "username", "\\}"), `username`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "username", "\\}"), URLencode(as.character(`username`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
|
||||
@ -197,7 +197,7 @@ UserApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/user/{username}"
|
||||
if (!missing(`username`)) {
|
||||
urlPath <- gsub(paste0("\\{", "username", "\\}"), `username`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "username", "\\}"), URLencode(as.character(`username`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
|
||||
@ -296,7 +296,7 @@ UserApi <- R6::R6Class(
|
||||
|
||||
urlPath <- "/user/{username}"
|
||||
if (!missing(`username`)) {
|
||||
urlPath <- gsub(paste0("\\{", "username", "\\}"), `username`, urlPath)
|
||||
urlPath <- gsub(paste0("\\{", "username", "\\}"), URLencode(as.character(`username`), reserved = TRUE), urlPath)
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user