Skip to content

Contains filter errors on more than one value #1085

Closed
@rachael-ross

Description

@rachael-ross

DESCRIPTION

When attempting to use the contains filter with more than one value, we receive an error.

STEPS TO REPRODUCE

If I try 'contains', I receive a syntax error:

/funds?filter=contains(ticker,'DRMBX','LHCAX')

If I try 'any', it returns the appropriate records that exactly match:

/funds?filter=any(ticker,'DRMBX','LHCAX')

EXPECTED BEHAVIOR

The documentation states Equals one value from set for any, which I interpret to mean a full match.

The documentation states 'Contains text' for contains, which I interpret to mean a partial match. From the documentation, the example below shows two values being passed to contains.

From https://www.jsonapi.net/usage/reading/filtering.html :
image

ACTUAL BEHAVIOR

{
    "errors": [
        {
            "id": "14207389-cfa8-435a-aece-47a3c7269c59",
            "status": "400",
            "title": "The specified filter is invalid.",
            "detail": ") expected.",
            "source": {
                "parameter": "filter"
            }
        }
    ]
}

VERSIONS USED

  • JsonApiDotNetCore version:
  • ASP.NET Core version:
  • Entity Framework Core version:
  • Database provider:

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions