Skip to content

No error when comparing count() with null #1283

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

Closed
bkoelman opened this issue Jun 14, 2023 · 0 comments · Fixed by #1286
Closed

No error when comparing count() with null #1283

bkoelman opened this issue Jun 14, 2023 · 0 comments · Fixed by #1286
Labels

Comments

@bkoelman
Copy link
Member

DESCRIPTION

Filter parsing should produce an error on comparison of count() with null.

STEPS TO REPRODUCE

Using the GettingStarted project, the following request:

GET /api/people?filter=equals(count(books),null) HTTP/1.1

succeeds, without matching anything.

EXPECTED BEHAVIOR

An error is produced, because the number of rows (int) can never match null.

Something along the lines of:

{
  "errors": [
    {
      "id": "1792eb76-56f3-45f5-bea0-c9a318d475e3",
      "status": "400",
      "title": "The specified filter is invalid.",
      "detail": "Failed to convert 'null' of type 'String' to type 'Int32'.",
      "source": {
        "parameter": "filter"
      }
    }
  ]
}

ACTUAL BEHAVIOR

No error is produced. The request succeeds without matching anything.

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