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) { diff --git a/openapi3/codegen-templates/api_client.mustache b/openapi3/codegen-templates/api_client.mustache index 420a1a3..8bab2a9 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) } @@ -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 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