Skip to content

Custom ISearchBinder does not support deeply nested $expand queries or single item queries #1472

@WanjohiSammy

Description

@WanjohiSammy

Assemblies affected
7.x and 8.x

Describe the bug
The ISearchBinder fails to handle deeply nested $expand queries or single item queries such as customers(1) or Customers/1. For example:

  • /Customers(1)?search=NOT (sam OR zz)
  • /Customers?expand=Orders(expand=Products(search=snack))

These queries do not filter data based on the provided search terms, unlike simpler queries such as /Customers?search=NOT (sam OR zz) which work as expected.

For more details, refer to the DevBlog.

Reproduce steps

  1. Clone the repository.
    git clone https://github.com/WanjohiSammy/ISearchBinderIssueWithSomeQueries.git
  2. Build and run the application.
  3. Test the following requests:
    • /Customers?search=NOT (sam OR zz) - Works as expected.
    • /Customers(6)?search=NOT (sam OR zz) - Returns everything. The custom ISearchBinder is not being triggered.
    • /Customers?expand=Orders(expand=Products(search=snack)) - Returns everything. The custom ISearchBinder is not being triggered.
    • /Customers(1)?expand=Orders(expand=Products(search=snack)) - Returns everything. The custom ISearchBinder is not being triggered.

Data Model
Please share your Data model, for example, your C# class.

EDM (CSDL) Model
Please share your Edm model, for example, CSDL file.
You can send $metadata to get a CSDL XML content.

Request/Response

  • Request URIs:

    • /Customers?search=NOT (sam OR zz)
    • /Customers(6)?search=NOT (sam OR zz)
    • /Customers?expand=Orders(expand=Products(search=snack))
    • /Customers(1)?expand=Orders(expand=Products(search=snack))
  • Expected Responses:
    Queries with $expand or single item queries should correctly filter data based on the search terms.

Expected behavior
Queries involving deeply nested $expand or single item queries should function correctly, similar to how /Customers?search=NOT (sam OR zz) behaves.

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Please share your call stack or any error message
Add any other context about the problem here.

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions