microsoft / microsoft/OpenAPI.NET.OData
Distinct does not work on Enumerable<IEdmStructuredType>
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 240
- 派生
- 70
- 平均合并
- 7 小时 59 分钟
- 30 天内合并 PR
- 13
描述
https://github.com/microsoft/OpenAPI.NET.OData/blame/c00a26b629e76d624f80911d4b97d9ae86af9cf7/src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiSchemaGenerator.cs#L197 produces duplicates, when there is a navigation property to an entity that is already associate in the entity sets. In our case the EntityType is not the same instance, so it MUST be compared by FullName to get distinct values. I made the same mistake recently, so it would be nice if there is a default comparer.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
打开 src/Microsoft.OpenApi.OData.Reader/Generator/OpenApiSchemaGenerator.cs 的第 197 行,检查 Enumerable 值是如何去重的。复现 issue 中描述的重复 entity-set 情况,并按 FullName 而不是实例标识比较实体。完成的标准是 navigation properties 不再产生重复值,并且现有测试套件通过。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 35/100