microsoft / microsoft/OpenAPI.NET.OData

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

未关闭
#612 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

priority:p1 type:enhancement
主要语言
C#
星标
240
派生
70
平均合并
7 小时 59 分钟
30 天内合并 PR
13

描述

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.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位对可复用 count/top/skip/filter 参数的现有处理,以及控制该处理的设置。跟踪当前如何生成 orderby、select 和 expand,然后验证启用该设置后会生成组件参数引用,同时在禁用该设置时保留现有行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp
领域
api, backend-api-design
Issue 类型
重构
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。