Skip to content

Commit

Permalink
Merge pull request #43 from Readify/json-depth
Browse files Browse the repository at this point in the history
Fix for ticket import not converting comments to json correctly.
  • Loading branch information
RobFaie authored May 26, 2020
2 parents de15ec7 + 2528811 commit 20e50d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions functions/Invoke-Method.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,9 @@ function Invoke-Method {
if ($PSBoundParameters.ContainsKey('Body')) {
if ($ContentType -eq 'application/json') {
if ($PSVersionTable.PSVersion -ge '6.2.0') {
$params.Body = $Body | ConvertTo-Json -Compress -EscapeHandling EscapeNonAscii
$params.Body = $Body | ConvertTo-Json -Depth 5 -Compress -EscapeHandling EscapeNonAscii
} else {
$params.Body = $Body | ConvertTo-Json -Compress | ConvertTo-UnicodeEscape
$params.Body = $Body | ConvertTo-Json -Depth 5 -Compress | ConvertTo-UnicodeEscape
}
} else {
$params.Body = $Body
Expand Down

0 comments on commit 20e50d7

Please sign in to comment.