From c73cafec6b5af04b8fee03f665e36421dd1db0ab Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 26 May 2020 10:17:02 +0800 Subject: [PATCH] ps minor style change (#6424) --- .../src/main/resources/powershell/configuration.mustache | 7 +++---- .../src/main/resources/powershell/model_anyof.mustache | 3 ++- .../src/main/resources/powershell/model_oneof.mustache | 3 ++- .../powershell/src/PSPetstore/Client/PSConfiguration.ps1 | 7 +++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/powershell/configuration.mustache b/modules/openapi-generator/src/main/resources/powershell/configuration.mustache index fdd6bda48cef..4d17452be17d 100644 --- a/modules/openapi-generator/src/main/resources/powershell/configuration.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/configuration.mustache @@ -86,7 +86,7 @@ Access token for authentication/authorization .PARAMETER SkipCertificateCheck Skip certificate verification -.PARAMETER DefaultHeaders +.PARAMETER DefaultHeaders Default HTTP headers to be included in the HTTP request .PARAMETER PassThru @@ -124,7 +124,6 @@ function Set-{{{apiNamePrefix}}}Configuration { if (!($null -ne $URL.AbsoluteURI -and $URL.Scheme -match '[http|https]')) { throw "Invalid URL '$($BaseUrl)' cannot be used in the base URL." } - $Script:Configuration["BaseUrl"] = $BaseUrl } @@ -156,7 +155,7 @@ function Set-{{{apiNamePrefix}}}Configuration { $Script:Configuration['SkipCertificateCheck'] = $true } else { $Script:Configuration['SkipCertificateCheck'] = $false - } + } If ($DefaultHeaders) { $Script:Configuration['DefaultHeaders'] = $DefaultHeaders @@ -325,7 +324,7 @@ Get the URL from the host settings. .PARAMETER Index Index of the host settings (array) -.PARAMETER Variables +.PARAMETER Variables Names and values of the variables (hashtable) .DESCRIPTION diff --git a/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache b/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache index e97311d83e6d..e30dc91a3462 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_anyof.mustache @@ -20,7 +20,7 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { Param ( [AllowEmptyString()] [string]$Json - ) + ) Process { $match = 0 @@ -53,6 +53,7 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { } } catch { # fail to match the schema defined in anyOf, proceed to the next one + Write-Debug "Failed to match '{{{.}}}' defined in anyOf ({{{apiNamePrefix}}}{{{classname}}}). Proceeding to the next one if any." } } diff --git a/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache b/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache index de8ace28ae08..98f4ab565d8b 100644 --- a/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache +++ b/modules/openapi-generator/src/main/resources/powershell/model_oneof.mustache @@ -20,7 +20,7 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { Param ( [AllowEmptyString()] [string]$Json - ) + ) Process { $match = 0 @@ -52,6 +52,7 @@ function ConvertFrom-{{{apiNamePrefix}}}JsonTo{{{classname}}} { } } catch { # fail to match the schema defined in oneOf, proceed to the next one + Write-Debug "Failed to match '{{{.}}}' defined in oneOf ({{{apiNamePrefix}}}{{{classname}}}). Proceeding to the next one if any." } {{/oneOf}} diff --git a/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 b/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 index 67577773b1d2..ddb37a19c6e2 100644 --- a/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 +++ b/samples/client/petstore/powershell/src/PSPetstore/Client/PSConfiguration.ps1 @@ -92,7 +92,7 @@ Access token for authentication/authorization .PARAMETER SkipCertificateCheck Skip certificate verification -.PARAMETER DefaultHeaders +.PARAMETER DefaultHeaders Default HTTP headers to be included in the HTTP request .PARAMETER PassThru @@ -130,7 +130,6 @@ function Set-PSConfiguration { if (!($null -ne $URL.AbsoluteURI -and $URL.Scheme -match '[http|https]')) { throw "Invalid URL '$($BaseUrl)' cannot be used in the base URL." } - $Script:Configuration["BaseUrl"] = $BaseUrl } @@ -162,7 +161,7 @@ function Set-PSConfiguration { $Script:Configuration['SkipCertificateCheck'] = $true } else { $Script:Configuration['SkipCertificateCheck'] = $false - } + } If ($DefaultHeaders) { $Script:Configuration['DefaultHeaders'] = $DefaultHeaders @@ -341,7 +340,7 @@ Get the URL from the host settings. .PARAMETER Index Index of the host settings (array) -.PARAMETER Variables +.PARAMETER Variables Names and values of the variables (hashtable) .DESCRIPTION