-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
When the schema specifies a ListNode and the data contains just one failing object, the output lists that failing object:
Code:
$data = @{
NonNodeData = @{
AzureAD = @{
AuthenticationMethodPolicy = @(
@{
IncorrectProperty1 = 8
IncorrectProperty2 = 10
}
@{
DefaultLength = 8
DefaultLifetimeInMinutes = 10
}
)
}
}
}
$schema = @{
NonNodeData = @{
'@Type' = 'PSMapNode'
AzureAD = @{
'@Type' = 'PSMapNode'
AuthenticationMethodPolicy = @(
@{
'@Type' = 'PSMapNode'
DefaultLength = @{ '@Type' = 'Int' }
DefaultLifetimeInMinutes = @{ '@Type' = 'Int' }
Ensure = @{ '@Type' = 'String' }
Id = @{ '@Type' = 'String' }
IncludeTargets = @(
@{
'@Type' = 'PSMapNode'
Id = @{ '@Type' = 'String' }
TargetType = @{ '@Type' = 'String' }
}
)
IsUsableOnce = @{ '@Type' = 'Bool' }
MaximumLifetimeInMinutes = @{ '@Type' = 'Int' }
MinimumLifetimeInMinutes = @{ '@Type' = 'Int' }
State = @{ '@Type' = 'String' }
}
)
}
}
}
$result = $data | Test-Object $schema
$resultOutput:
Path Value Valid Issue
---- ----- ----- -----
NonNodeData.AzureAD.AuthenticationMethodPolicy[0] @{IncorrectPr…=10;IncorrectPr…=8} [X] The following nodes are not accepted: IncorrectPr…, IncorrectPr…
NonNodeData.AzureAD.AuthenticationMethodPolicy @(@{IncorrectPr…=…;…},@{DefaultLeng…=…;…}) [X] The following nodes are not accepted: 0
NonNodeData.AzureAD @{Authenticat…=@(…)} [X] The following nodes are not accepted: Authenticat…
NonNodeData @{AzureAD=@{Authenticat…=…}} [X] The following nodes are not accepted: AzureAD
@{NonNodeData=@{AzureAD=…}} [X] The following nodes are not accepted: NonNodeDataThe first line in the output specifies the NonNodeData.AzureAD.AuthenticationMethodPolicy[0] object which is failing, with the failing parameters in the Issue column.
When specifying two objects that are failing, the code suddenly ignores the individual objects in the output:
Code:
$data = @{
NonNodeData = @{
AzureAD = @{
AuthenticationMethodPolicy = @(
@{
IncorrectProperty1 = 8
IncorrectProperty2 = 10
}
@{
IncorrectProperty1 = 16
IncorrectProperty2 = 20
}
)
}
}
}
$schema = @{
NonNodeData = @{
'@Type' = 'PSMapNode'
AzureAD = @{
'@Type' = 'PSMapNode'
AuthenticationMethodPolicy = @(
@{
'@Type' = 'PSMapNode'
DefaultLength = @{ '@Type' = 'Int' }
DefaultLifetimeInMinutes = @{ '@Type' = 'Int' }
Ensure = @{ '@Type' = 'String' }
Id = @{ '@Type' = 'String' }
IncludeTargets = @(
@{
'@Type' = 'PSMapNode'
Id = @{ '@Type' = 'String' }
TargetType = @{ '@Type' = 'String' }
}
)
IsUsableOnce = @{ '@Type' = 'Bool' }
MaximumLifetimeInMinutes = @{ '@Type' = 'Int' }
MinimumLifetimeInMinutes = @{ '@Type' = 'Int' }
State = @{ '@Type' = 'String' }
}
)
}
}
}
$result = $data | Test-Object $schema
$resultOutput:
Path Value Valid Issue
---- ----- ----- -----
NonNodeData.AzureAD.AuthenticationMethodPolicy @(@{IncorrectPr…=…;…},@{IncorrectPr…=…;…}) [X] The following nodes are not accepted: 0, 1
NonNodeData.AzureAD @{Authenticat…=@(…)} [X] The following nodes are not accepted: Authenticat…
NonNodeData @{AzureAD=@{Authenticat…=…}} [X] The following nodes are not accepted: AzureADHere I would have expected two additional lines at the top with like this:
```PowerShell
Path Value Valid Issue
---- ----- ----- -----
NonNodeData.AzureAD.AuthenticationMethodPolicy[1] @{IncorrectPr…=10;IncorrectPr…=8} [X] The following nodes are not accepted: IncorrectPr…, IncorrectPr…
NonNodeData.AzureAD.AuthenticationMethodPolicy[0] @{IncorrectPr…=10;IncorrectPr…=8} [X] The following nodes are not accepted: IncorrectPr…, IncorrectPr…
NonNodeData.AzureAD.AuthenticationMethodPolicy @(@{IncorrectPr…=…;…},@{DefaultLeng…=…;…}) [X] The following nodes are not accepted: 0
NonNodeData.AzureAD @{Authenticat…=@(…)} [X] The following nodes are not accepted: Authenticat…
NonNodeData @{AzureAD=@{Authenticat…=…}} [X] The following nodes are not accepted: AzureAD
@{NonNodeData=@{AzureAD=…}} [X] The following nodes are not accepted: NonNodeDataHowever, when using the -Elaborate parameter, these failing parameters are mentioned in the output, with all other output. So somehow they are filtered when not specifying that parameter.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels