forked from loafle/openapi-generator-original
[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}}
|
{{#hasPathParams}}
|
||||||
{{#pathParams}}
|
{{#pathParams}}
|
||||||
if (!missing(`{{paramName}}`)) {
|
if (!missing(`{{paramName}}`)) {
|
||||||
urlPath <- gsub(paste0("\\{", "{{baseName}}", "\\}"), `{{paramName}}`, urlPath)
|
urlPath <- gsub(paste0("\\{", "{{baseName}}", "\\}"), URLencode(as.character(`{{paramName}}`), reserved = TRUE), urlPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
{{/pathParams}}
|
{{/pathParams}}
|
||||||
|
@ -104,7 +104,7 @@ PetApi <- R6::R6Class(
|
|||||||
|
|
||||||
urlPath <- "/pet/{petId}"
|
urlPath <- "/pet/{petId}"
|
||||||
if (!missing(`pet.id`)) {
|
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
|
# OAuth token
|
||||||
@ -199,7 +199,7 @@ PetApi <- R6::R6Class(
|
|||||||
|
|
||||||
urlPath <- "/pet/{petId}"
|
urlPath <- "/pet/{petId}"
|
||||||
if (!missing(`pet.id`)) {
|
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
|
# API key authentication
|
||||||
@ -274,7 +274,7 @@ PetApi <- R6::R6Class(
|
|||||||
|
|
||||||
urlPath <- "/pet/{petId}"
|
urlPath <- "/pet/{petId}"
|
||||||
if (!missing(`pet.id`)) {
|
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
|
# OAuth token
|
||||||
@ -312,7 +312,7 @@ PetApi <- R6::R6Class(
|
|||||||
|
|
||||||
urlPath <- "/pet/{petId}/uploadImage"
|
urlPath <- "/pet/{petId}/uploadImage"
|
||||||
if (!missing(`pet.id`)) {
|
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
|
# OAuth token
|
||||||
|
@ -55,7 +55,7 @@ StoreApi <- R6::R6Class(
|
|||||||
|
|
||||||
urlPath <- "/store/order/{orderId}"
|
urlPath <- "/store/order/{orderId}"
|
||||||
if (!missing(`order.id`)) {
|
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}"
|
urlPath <- "/store/order/{orderId}"
|
||||||
if (!missing(`order.id`)) {
|
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}"
|
urlPath <- "/user/{username}"
|
||||||
if (!missing(`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}"
|
urlPath <- "/user/{username}"
|
||||||
if (!missing(`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}"
|
urlPath <- "/user/{username}"
|
||||||
if (!missing(`username`)) {
|
if (!missing(`username`)) {
|
||||||
urlPath <- gsub(paste0("\\{", "username", "\\}"), `username`, urlPath)
|
urlPath <- gsub(paste0("\\{", "username", "\\}"), URLencode(as.character(`username`), reserved = TRUE), urlPath)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user