Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference service OData lambda queries don't work #374

Open
ideafixxxer opened this issue Dec 4, 2024 · 0 comments
Open

Reference service OData lambda queries don't work #374

ideafixxxer opened this issue Dec 4, 2024 · 0 comments

Comments

@ideafixxxer
Copy link

Hello,

I’m trying to use OData reference service with OData ‘any’ function and getting errors consistently.

These examples

http://services.odata.org/TripPinRESTierService/(S(3mslpb2bc0k5ufk24olpghzx))/People?$filter=AddressInfo/any(o:o/Address eq '87 Polk St. Suite 5')
http://services.odata.org/TripPinRESTierService/(S(3mslpb2bc0k5ufk24olpghzx))/People?$filter=Emails/any(o:o eq '[email protected]')

produce

{
    "error": {
        "code": "",
        "message": "Value cannot be null.\r\nParameter name: source"
    }
}

I cannot check if the collection itself is null

http://services.odata.org/TripPinRESTierService/(S(3mslpb2bc0k5ufk24olpghzx))/People?$filter=Emails ne null

{
    "error": {
        "code": "",
        "message": "The operand for a binary operator 'NotEqual' is not a single value. Binary operators require both operands to be single values."
    }
}

If I use the lamda query from the collection
http://services.odata.org/TripPinRESTierService/(S(3mslpb2bc0k5ufk24olpghzx))/Me/Friends?$filter=Friends/any(f:f/FirstName eq 'Scott')

it doesn’t return an error, however it doesn’t seem to work correctly since none of the results have string “Scott” in them

{
    "@odata.context": "https://services.odata.org/TripPinRESTierService/(S(3mslpb2bc0k5ufk24olpghzx))/$metadata#People",
    "value": [
        {
            "UserName": "russellwhyte",
            "FirstName": "Russell",
            "LastName": "Whyte",
            "MiddleName": null,
            "Gender": "Male",
            "Age": null,
            "Emails": [
                "[email protected]",
                "[email protected]"
            ],
            "FavoriteFeature": "Feature1",
            "Features": [
                "Feature1",
                "Feature2"
            ],
            "AddressInfo": [
                {
                    "Address": "187 Suffolk Ln.",
                    "City": {
                        "Name": "Boise",
                        "CountryRegion": "United States",
                        "Region": "ID"
                    }
                }
            ],
            "HomeAddress": null
        },
        {
            "UserName": "ronaldmundy",
            "FirstName": "Ronald",
            "LastName": "Mundy",
            "MiddleName": null,
            "Gender": "Male",
            "Age": null,
            "Emails": [
                "[email protected]",
                "[email protected]"
            ],
            "FavoriteFeature": "Feature1",
            "Features": [],
            "AddressInfo": [
                {
                    "Address": "187 Suffolk Ln.",
                    "City": {
                        "Name": "Boise",
                        "CountryRegion": "United States",
                        "Region": "ID"
                    }
                }
            ],
            "HomeAddress": null
        }
    ]
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant