microsoft / microsoft/OpenAPI.NET.OData

Optimization - reusable components for orderby/expand/select query parameters

Open
#612 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority:p1 type:enhancement
Dominant language
C#
Stars
240
Forks
70
Avg merge
7h 59m
Merged PRs (30d)
13

Description

Since #197 was implemented through #499, we have a big opportunity to make descriptions much smaller.

Effectively all operations now have the same definition for those query parameters when they support it

        - name: $orderby
          in: query
          description: Order items by property values
          style: form
          explode: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: $select
          in: query
          description: Select properties to be returned
          style: form
          explode: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string
        - name: $expand
          in: query
          description: Expand related entities
          style: form
          explode: false
          schema:
            uniqueItems: true
            type: array
            items:
              type: string

When the setting it on, we should do the same thing we do for count/top/skip/filter... and have instead

 - $ref: '#/components/parameters/expand'
 - $ref: '#/components/parameters/select'
 - $ref: '#/components/parameters/orderby'

Which would save a ton of repetition throughout the final description.

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 locating the existing handling for reusable count/top/skip/filter parameters and the setting that controls it. Trace how orderby, select, and expand are currently emitted, then verify that enabling the setting produces component parameter references while preserving the existing behavior when it is disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api, backend-api-design
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.