microsoft / microsoft/api-guidelines

Filters: "in" operator

Open
#168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
23.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

Frequently, there are filter expressions where the same attribute is compared with multiple values like -

$filter=categoryId eq 'cat1000' or categoryId eq 'cat1001' or categoryId eq 'cat1002'

It is very desirable to write the above as

$filter=categoryId in ['cat1000', 'cat1001', 'cat1002']

This is less verbose and much better for human readability and visual debugging, especially when combining multiple such filter conditions. Eg. $filter=categoryId in ['cat1000', 'cat1001', 'cat1002'] and productId not in ['201', '210'].

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing API Guidelines material for filter expressions and related operator conventions. Determine whether the requested in and not in syntax belongs in the guidelines and define the documentation or specification changes needed; done means the proposal has a settled scope and corresponding guidance.

Written by the indexing model from the issue text.

Assessment

Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.