microsoft / microsoft/OpenAPI.NET.OData
orderby/select/expand should be oneOf when UseStringArrayForQueryOptionsSchema is false
未关闭
还没有人认领这个 Issue。
priority:p1
type:bug
- 主要语言
- C#
- 星标
- 240
- 派生
- 70
- 平均合并
- 7 小时 59 分钟
- 30 天内合并 PR
- 13
描述
Currently we describe
parameters:
- name: $select
in: query
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
type: string
enum:
- id
- firstName
- ....
It should instead be
parameters:
- name: $select
in: query
style: form
explode: false
schema:
uniqueItems: true
type: array
items:
oneOf:
- type: string
- type: string
enum:
- id
- firstName
- ....
This is because for any navigation property you can write $select=navProperty($expand=subproperty) and we don't want to project all possibilities. But we don't want to restrict clients to simply the scalar/first level properties.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先定位 UseStringArrayForQueryOptionsSchema 以及 $select、$orderby 和 $expand 的架构生成逻辑。将当前生成的 OpenAPI 架构与 issue 中的示例进行比较;当导航属性表达式仍然可用,同时标量属性和第一级属性通过所请求的 oneOf 结构表示时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp, openapi
- 领域
- api
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100