From 84ab4efa4f1351c91e61a677692c374e033302e1 Mon Sep 17 00:00:00 2001 From: Gabriel Sroka Date: Mon, 22 Apr 2024 09:35:36 -0700 Subject: [PATCH 1/4] Update okta_authenticationApi.mustache --- openapi3/codegen-templates/okta_authenticationApi.mustache | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openapi3/codegen-templates/okta_authenticationApi.mustache b/openapi3/codegen-templates/okta_authenticationApi.mustache index c60d906..e4d0947 100644 --- a/openapi3/codegen-templates/okta_authenticationApi.mustache +++ b/openapi3/codegen-templates/okta_authenticationApi.mustache @@ -62,7 +62,8 @@ function Invoke-OktaEstablishAccessToken { $DeviceUrl = $LocalVarResult.Response.verification_uri_complete $DeviceCode = $LocalVarResult.Response.device_code - Write-Host "Open your browser and navigate to the following URL to begin the Okta device authorization for the Powershell CLI: " $DeviceUrl + Write-Host "Open your browser and navigate to the following URL to begin the Okta device authorization for the PowerShell CLI:" + Write-Host $DeviceUrl $keepPolling = $true $CountPolling = 1 From 0515326d4299014bf4a5a90a7a6b589601777fb3 Mon Sep 17 00:00:00 2001 From: Gabriel Sroka Date: Sat, 4 May 2024 18:01:31 -0700 Subject: [PATCH 2/4] Update api_client.mustache --- openapi3/codegen-templates/api_client.mustache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openapi3/codegen-templates/api_client.mustache b/openapi3/codegen-templates/api_client.mustache index 420a1a3..d822cd4 100644 --- a/openapi3/codegen-templates/api_client.mustache +++ b/openapi3/codegen-templates/api_client.mustache @@ -75,7 +75,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { # construct URL query string $HttpValues = [System.Web.HttpUtility]::ParseQueryString([String]::Empty) foreach ($Parameter in $QueryParameters.GetEnumerator()) { - if ($Parameter.Value.Count -gt 1) { // array + if ($Parameter.Value.Count -gt 1) { # array foreach ($Value in $Parameter.Value) { $HttpValues.Add($Parameter.Key + '[]', $Value) } From 1f3d841df2cec0bcf3c401ff90e32b58294cb765 Mon Sep 17 00:00:00 2001 From: Gabriel Sroka Date: Sat, 4 May 2024 18:33:02 -0700 Subject: [PATCH 3/4] Update api_client.mustache --- openapi3/codegen-templates/api_client.mustache | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openapi3/codegen-templates/api_client.mustache b/openapi3/codegen-templates/api_client.mustache index d822cd4..8bab2a9 100644 --- a/openapi3/codegen-templates/api_client.mustache +++ b/openapi3/codegen-templates/api_client.mustache @@ -91,23 +91,23 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { if ($FormParameters -and $FormParameters.Count -gt 0) { if (![string]::IsNullOrEmpty($MultiPartBoundary)) { $RequestBody = "" - $LF = "`r`n" + $CRLF = "`r`n" $FormParameters.Keys | ForEach-Object { $value = $FormParameters[$_] $isFile = $value.GetType().FullName -eq "System.IO.FileInfo" - $RequestBody += "--$MultiPartBoundary$LF" + $RequestBody += "--$MultiPartBoundary$CRLF" $RequestBody += "Content-Disposition: form-data; name=`"$_`"" if ($isFile) { $fileName = $value.Name - $RequestBody += "; filename=`"$fileName`"$LF" - $RequestBody += "Content-Type: application/octet-stream$LF$LF" + $RequestBody += "; filename=`"$fileName`"$CRLF" + $RequestBody += "Content-Type: application/octet-stream$CRLF$CRLF" $RequestBody += Get-Content -Path $value.FullName } else { - $RequestBody += "$LF$LF" + $RequestBody += "$CRLF$CRLF" $RequestBody += ([string]$value) } - $RequestBody += "$LF--$MultiPartBoundary" + $RequestBody += "$CRLF--$MultiPartBoundary" } $RequestBody += "--" } else { @@ -202,7 +202,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { $Response = $null - if ($RawResponse.StatusCode -ne '204') { + if ($RawResponse.StatusCode -ne 204) { $Response = DeserializeResponse -Response $RawResponse.Content -ReturnType $ReturnType -ContentTypes $RawResponse.Headers["Content-Type"] } @@ -227,7 +227,7 @@ function Invoke-{{{apiNamePrefix}}}ApiClient { $RetryFlag = $false } } - } while($RetryFlag) + } while ($RetryFlag) return @{ Response = $Response From 880b3ce934d2eb6bc30c298c83576f95b8cbe77d Mon Sep 17 00:00:00 2001 From: Gabriel Sroka Date: Sat, 4 May 2024 18:36:32 -0700 Subject: [PATCH 4/4] Update api.mustache --- openapi3/codegen-templates/api.mustache | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openapi3/codegen-templates/api.mustache b/openapi3/codegen-templates/api.mustache index a6ad4ce..8e770ee 100644 --- a/openapi3/codegen-templates/api.mustache +++ b/openapi3/codegen-templates/api.mustache @@ -195,10 +195,10 @@ function {{{vendorExtensions.x-powershell-method-name}}} { if ($IncludeNullValues.IsPresent) { - $LocalVarBodyParameter = ${{{paramName}}} | ConvertTo-Json -Depth 100 + $LocalVarBodyParameter = ${{{paramName}}} | ConvertTo-Json -Depth 100 -Compress } else{ - $LocalVarBodyParameter = Remove-NullProperties -InputObject ${{{paramName}}} | ConvertTo-Json -Depth 100 + $LocalVarBodyParameter = Remove-NullProperties -InputObject ${{{paramName}}} | ConvertTo-Json -Depth 100 -Compress } {{/bodyParam}} @@ -259,12 +259,12 @@ function {{{vendorExtensions.x-powershell-method-name}}} { {{#vendorExtensions.x-ps-return-type-one-of}} # process oneOf response - $LocalVarResult["Response"] = ConvertFrom-{{apiNamePrefix}}JsonTo{{returnType}} (ConvertTo-Json $LocalVarResult["Response"] -Depth 100) + $LocalVarResult["Response"] = ConvertFrom-{{apiNamePrefix}}JsonTo{{returnType}} (ConvertTo-Json $LocalVarResult["Response"] -Depth 100 -Compress) {{/vendorExtensions.x-ps-return-type-one-of}} {{#vendorExtensions.x-ps-return-type-any-of}} # process anyOf response - $LocalVarResult["Response"] = ConvertFrom-{{apiNamePrefix}}JsonTo{{returnType}} (ConvertTo-Json $LocalVarResult["Response"] -Depth 100) + $LocalVarResult["Response"] = ConvertFrom-{{apiNamePrefix}}JsonTo{{returnType}} (ConvertTo-Json $LocalVarResult["Response"] -Depth 100 -Compress) {{/vendorExtensions.x-ps-return-type-any-of}} if ($WithHttpInfo.IsPresent) {