-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Include @TriggerAu's contribution (#51)
- Update Remove-NullPropertiesFromArray to ensure an array is always returned - Add tests to verify functionality - Fix #43 Signed-off-by: Laura Rodriguez <[email protected]>
- Loading branch information
1 parent
d3d8fc5
commit 4849f7a
Showing
8 changed files
with
112 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
# | ||
# Okta Management | ||
# Allows customers to easily access the Okta Management APIs | ||
# Version: 3.0.0 | ||
# Contact: [email protected] | ||
# Generated by OpenAPI Generator: https://openapi-generator.tech | ||
# | ||
# | ||
# Okta Management | ||
# Allows customers to easily access the Okta Management APIs | ||
# Version: 3.0.0 | ||
# Contact: [email protected] | ||
# Generated by OpenAPI Generator: https://openapi-generator.tech | ||
# | ||
|
||
|
||
# Remove null properties from an object recursively | ||
|
@@ -35,7 +35,7 @@ function Remove-NullProperties { | |
foreach ($Property in $PropertyList) { | ||
if($Property.Value -is [array]){ | ||
# explicit cast to avoid arrays to be converted to object (i.e @('foo')) | ||
$NewObject[$Property.Name] = [array]@(Remove-NullProperties $Property.Value) | ||
$NewObject[$Property.Name] = Remove-NullPropertiesFromArray $Property.Value | ||
}else{ | ||
$NewObject[$Property.Name] = Remove-NullProperties $Property.Value | ||
} | ||
|
@@ -74,7 +74,6 @@ function Remove-NullPropertiesFromHashMap{ | |
} | ||
|
||
# Remove null properties from an array recursively | ||
|
||
function Remove-NullPropertiesFromArray { | ||
[CmdletBinding()] | ||
param( | ||
|
@@ -90,5 +89,7 @@ function Remove-NullPropertiesFromArray { | |
$NewArray += $NewItem | ||
} | ||
|
||
return $NewArray | ||
#https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_operators?view=powershell-7.4#comma-operator- | ||
# Ensure the return is always an array, even if there's only one item | ||
return ,$NewArray | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters