Closed swayongshen closed 11 months ago
Not a bug per se because in the end the odata specification is pretty clear that search is kind of up to the implementation :)
Example 107: all products that are blue or green. It is up to the service to decide what makes a product blue or green.
http://host/service/Products?$search=blue OR green
That being said you can override the search behavior by implementing the checkSearchQuery
on your mock data file.
The base implementation is just doing a string.includes :)
here is the signature of the method, let me know if this helps
checkSearchQuery(mockValue: any, searchQuery: string, odataRequest: ODataRequest): boolean
Ok, thank you :+1:
Description
Not sure if this is intended or not, but in a CAP server, the
$search
URL query param results in case-insensitive search, but in the mockserver its case-sensitive. So we have a different behavior when developing locally versus when interacting with the backend.Steps to Reproduce
Steps to reproduce the behavior:
$search
param.Expected results
Should return results based on case-insensitive matching.
Actual results
Return results with case-sensitive matching.
Screenshots
If applicable, add screenshots to help explain the problem.
Version/Components/Environment
Add any other context about the problem here OS:
Root Cause Analysis
Problem
{describe the problem}
Fix
{describe the fix}
Why was it missed
{Some explanation why this issue might have been missed during normal development/testing cycle}
How can we avoid this
{if we don’t want to see this type of issues anymore what we should do to prevent}