forked from loafle/openapi-generator-original
encode URL parameters (#9688)
This commit is contained in:
@@ -90,7 +90,7 @@ function {{{vendorExtensions.x-powershell-method-name}}} {
|
|||||||
if (!$<paramName>) {
|
if (!$<paramName>) {
|
||||||
throw "Error! The required parameter `<paramName>` missing when calling <operationId>."
|
throw "Error! The required parameter `<paramName>` missing when calling <operationId>."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{<baseName>}', $<paramName>)
|
$LocalVarUri = $LocalVarUri.replace('{<baseName>}', [System.Web.HTTPUtility]::UrlEncode($<paramName>))
|
||||||
</pathParams>
|
</pathParams>
|
||||||
<={{ }}=>
|
<={{ }}=>
|
||||||
|
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ function Remove-Pet {
|
|||||||
if (!$PetId) {
|
if (!$PetId) {
|
||||||
throw "Error! The required parameter `PetId` missing when calling deletePet."
|
throw "Error! The required parameter `PetId` missing when calling deletePet."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{petId}', $PetId)
|
$LocalVarUri = $LocalVarUri.replace('{petId}', [System.Web.HTTPUtility]::UrlEncode($PetId))
|
||||||
|
|
||||||
if ($ApiKey) {
|
if ($ApiKey) {
|
||||||
$LocalVarHeaderParameters['api_key'] = $ApiKey
|
$LocalVarHeaderParameters['api_key'] = $ApiKey
|
||||||
@@ -415,7 +415,7 @@ function Get-PSPetById {
|
|||||||
if (!$PetId) {
|
if (!$PetId) {
|
||||||
throw "Error! The required parameter `PetId` missing when calling getPetById."
|
throw "Error! The required parameter `PetId` missing when calling getPetById."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{petId}', $PetId)
|
$LocalVarUri = $LocalVarUri.replace('{petId}', [System.Web.HTTPUtility]::UrlEncode($PetId))
|
||||||
|
|
||||||
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key"]) {
|
if ($Configuration["ApiKey"] -and $Configuration["ApiKey"]["api_key"]) {
|
||||||
$LocalVarHeaderParameters['api_key'] = $Configuration["ApiKey"]["api_key"]
|
$LocalVarHeaderParameters['api_key'] = $Configuration["ApiKey"]["api_key"]
|
||||||
@@ -596,7 +596,7 @@ function Update-PSPetWithForm {
|
|||||||
if (!$PetId) {
|
if (!$PetId) {
|
||||||
throw "Error! The required parameter `PetId` missing when calling updatePetWithForm."
|
throw "Error! The required parameter `PetId` missing when calling updatePetWithForm."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{petId}', $PetId)
|
$LocalVarUri = $LocalVarUri.replace('{petId}', [System.Web.HTTPUtility]::UrlEncode($PetId))
|
||||||
|
|
||||||
if ($Name) {
|
if ($Name) {
|
||||||
$LocalVarFormParameters['name'] = $Name
|
$LocalVarFormParameters['name'] = $Name
|
||||||
@@ -693,7 +693,7 @@ function Invoke-PSUploadFile {
|
|||||||
if (!$PetId) {
|
if (!$PetId) {
|
||||||
throw "Error! The required parameter `PetId` missing when calling uploadFile."
|
throw "Error! The required parameter `PetId` missing when calling uploadFile."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{petId}', $PetId)
|
$LocalVarUri = $LocalVarUri.replace('{petId}', [System.Web.HTTPUtility]::UrlEncode($PetId))
|
||||||
|
|
||||||
if ($AdditionalMetadata) {
|
if ($AdditionalMetadata) {
|
||||||
$LocalVarFormParameters['additionalMetadata'] = $AdditionalMetadata
|
$LocalVarFormParameters['additionalMetadata'] = $AdditionalMetadata
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ function Remove-PSOrder {
|
|||||||
if (!$OrderId) {
|
if (!$OrderId) {
|
||||||
throw "Error! The required parameter `OrderId` missing when calling deleteOrder."
|
throw "Error! The required parameter `OrderId` missing when calling deleteOrder."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{orderId}', $OrderId)
|
$LocalVarUri = $LocalVarUri.replace('{orderId}', [System.Web.HTTPUtility]::UrlEncode($OrderId))
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'DELETE' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'DELETE' `
|
||||||
-Uri $LocalVarUri `
|
-Uri $LocalVarUri `
|
||||||
@@ -206,7 +206,7 @@ function Get-PSOrderById {
|
|||||||
if (!$OrderId) {
|
if (!$OrderId) {
|
||||||
throw "Error! The required parameter `OrderId` missing when calling getOrderById."
|
throw "Error! The required parameter `OrderId` missing when calling getOrderById."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{orderId}', $OrderId)
|
$LocalVarUri = $LocalVarUri.replace('{orderId}', [System.Web.HTTPUtility]::UrlEncode($OrderId))
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
||||||
-Uri $LocalVarUri `
|
-Uri $LocalVarUri `
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ function Remove-PSUser {
|
|||||||
if (!$Username) {
|
if (!$Username) {
|
||||||
throw "Error! The required parameter `Username` missing when calling deleteUser."
|
throw "Error! The required parameter `Username` missing when calling deleteUser."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{username}', $Username)
|
$LocalVarUri = $LocalVarUri.replace('{username}', [System.Web.HTTPUtility]::UrlEncode($Username))
|
||||||
|
|
||||||
if ($Configuration["Cookie"]) {
|
if ($Configuration["Cookie"]) {
|
||||||
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
$LocalVarCookieParameters['auth_cookie'] = $Configuration["Cookie"]
|
||||||
@@ -383,7 +383,7 @@ function Get-PSUserByName {
|
|||||||
if (!$Username) {
|
if (!$Username) {
|
||||||
throw "Error! The required parameter `Username` missing when calling getUserByName."
|
throw "Error! The required parameter `Username` missing when calling getUserByName."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{username}', $Username)
|
$LocalVarUri = $LocalVarUri.replace('{username}', [System.Web.HTTPUtility]::UrlEncode($Username))
|
||||||
|
|
||||||
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
$LocalVarResult = Invoke-PSApiClient -Method 'GET' `
|
||||||
-Uri $LocalVarUri `
|
-Uri $LocalVarUri `
|
||||||
@@ -624,7 +624,7 @@ function Update-PSUser {
|
|||||||
if (!$Username) {
|
if (!$Username) {
|
||||||
throw "Error! The required parameter `Username` missing when calling updateUser."
|
throw "Error! The required parameter `Username` missing when calling updateUser."
|
||||||
}
|
}
|
||||||
$LocalVarUri = $LocalVarUri.replace('{username}', $Username)
|
$LocalVarUri = $LocalVarUri.replace('{username}', [System.Web.HTTPUtility]::UrlEncode($Username))
|
||||||
|
|
||||||
if (!$User) {
|
if (!$User) {
|
||||||
throw "Error! The required parameter `User` missing when calling updateUser."
|
throw "Error! The required parameter `User` missing when calling updateUser."
|
||||||
|
|||||||
Reference in New Issue
Block a user