Open
Description
I'm trying to apply this expression to the following document
length((components[?type == 'Stepper'].children | @[].validationState)[?@ == 'NotValid']) == `0`
{
"components": [
{
"type": "Stepper",
"children": [
{
"validationState": "NotValid"
},
{
"validationState": "Valid"
}
]
}
]
}
The expected result should be "false", as it is the actual value returned by the online tester https://jmespath.org/.
var text = File.ReadAllText(Path.Combine("test_files", "projection_issue.json"));
var jsonOptions = new JsonDocumentOptions();
jsonOptions.CommentHandling = JsonCommentHandling.Skip;
using JsonDocument doc = JsonDocument.Parse(text, jsonOptions);
var expression = JsonTransformer.Parse("length((components[?type == 'Stepper'].children | @[].validationState)[?@ == 'NotValid']) == `0`");
var result = expression.Transform(doc.RootElement);
Assert.IsFalse(result.RootElement.GetBoolean());
This unit test is currently failing.
Metadata
Metadata
Assignees
Labels
No labels