Skip to content

json: follow up for not existing members #960

Description

@paule96

Note: this is a new topic to the issue #952

In my opinion their are still two unresolved edge cases.
The first edge case is when any property is null in the source object like that:

private JsonDocument _jsonDoc = JsonDocument.Parse
(
    """
        [
            {
                "a": "1",
                "b": 2,
                "c": true,
                "d": null
            },

            {
                "a": "12",
                "b": 22,
                "c": true,
                "d": null
            }
        ]
        """
);

Then any query of the test in your tests is then red:

https://github.com/zzzprojects/System.Linq.Dynamic.Core/blob/aa47b50f1da56ddb2eb4dc7b24320684a53ab18e/test/System.Linq.Dynamic.Core.SystemTextJson.Tests/SystemTextJsonTests.cs#L540C4-L560C6

The second broken case is if you compare some number to a not exisiting member to be bigger then the not existing member, then it will return true.

So something like that:

_source.Any(config, $"x => x.notExisting < 1"); // The result will be a not empty list

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions