Azure / Azure/azure-rest-api-specs
RecoveryServices/backupProtectedItems endpoint -> $filter on friendlyName is broken
- Dominant language
- TypeSpec
- Stars
- 3.1k
- Forks
- 5.9k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 424
Description
Hello,
Using ``$filter`` on ``friendlyName`` on ``backupProtectedItems`` (https://docs.microsoft.com/en-us/rest/api/backup/backup-protected-items/list) always returns **all** ``backupProtectedItems`` independent of the filter configured.
**How to reproduce**
Fire a GET towards
``https://management.azure.com/subscriptions/${SUBSCRIPTION}/resourceGroups/${RGNAME}/providers/Microsoft.RecoveryServices/vaults/${VAULTNAME}/backupProtectedItems?api-version=2021-02-10&$filter=friendlyName%20eq%20'thisisnotamatch'``
**Expected result** (unless you protected a share with name 'thisisnotamatch'):
```
{
"value": []
}
```
**Actual result** (all protected items with various ``friendlyName``s):
```
{
"value": [ {item1},{item2},...,{item n}]
}
```
Filtering on ``backupManagementType`` on the other hand (as in the example) works as expected.
Either the documentation lacks a list of properties that are supported by the filter, it requires another kind of "object/type" (as opposed to string on the right side of the comparison) or this is a bug.
In the first both cases I'd somehow expect to get an error (as it happens with an invalid filter string) instead of silently returning all elements...
Contributor guide
Research direction
Start by locating the RecoveryServices backupProtectedItems specification and reviewing the list operation's $filter definition for api-version 2021-02-10. Compare the documented filter properties with the reported friendlyName request and determine whether the specification should document supported behavior or report the service-side issue; done means the expected behavior is clearly captured.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- api, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100