Unify Handling of allOf/anyOf and oneOf in Diff logic
维护者通常 5 天内回复
还没有人认领这个 Issue。
评估
调研方向
先从 SchemaDiff#resolveComposedSchema 和 SchemaDiff#addSchema 开始,了解 allOf/anyOf 是如何被扁平化的,然后阅读 ComposedSchemaDiffResult#diff 和 ChangedOneOfSchema,了解现有的 oneOf 比较方式。定义 allOf/anyOf 中的结构性新增、删除和修改应如何与扁平化属性变更一起呈现;当 diff 能够一致地报告组合变更且不丢失相关细节时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Current Behavior:
The diffing mechanism currently handles allOf/anyOf and oneOf differently within composed schemas:
-
allOf/anyOf: These schemas are recursively resolved and their properties are merged into the parent schema before the main diffing occurs. This happens inSchemaDiff#resolveComposedSchema, where properties fromallOf/anyOfsubschemas are added to the parent usingSchemaDiff#addSchema. The originalallOf/anyOfstructure is effectively flattened. -
oneOf: These schemas are not merged beforehand. Instead, theComposedSchemaDiffResult#diffmethod performs a structural comparison of theoneOflists between the old and new schemas. It identifies added, removed, or changedoneOfoptions, storing the results in aChangedOneOfSchemaobject which is then attached to theChangedSchema.
Suggested Behavior:
This difference in processing leads to an inconsistency. While the merging for allOf/anyOf simplifies property comparison later, it loses the structural information about changes within the allOf/anyOf lists. Conversely, oneOf retains this structural information because it's crucial for understanding changes in available options.
Consider unifying the approach. Perhaps allOf/anyOf could also be compared structurally, similar to oneOf, to provide a more consistent and potentially more informative diff result regarding the composition itself, rather than just the flattened outcome. This would allow tracking additions, removals, or modifications within allOf/anyOf lists directly.
- 主要语言
- Java
- 星标
- 1.1k
- 派生
- 191
- 平均合并
- 4 天 23 小时
- 30 天内合并 PR
- 1
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenAPITools/openapi-diff 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 68/100
OpenAPITools/openapi-diff#506 ·
维护者通常 5 天内回复
-
HtmlRender: Notes of Parameters shows always the new description可能已有人在做 @Inf1mum 于 6 天前认领。 未关闭good first issue help wanted
难度 2/5 1-3 小时 新手友好度 68/100
OpenAPITools/openapi-diff#364 ·
维护者通常 5 天内回复
-
Render capabilities
难度 5/5 一周以上 新手友好度 20/100
OpenAPITools/openapi-diff#959 ·
维护者通常 5 天内回复
-
Render capabilities
难度 5/5 一周以上 新手友好度 18/100
OpenAPITools/openapi-diff#958 ·
维护者通常 5 天内回复
-
Render capabilities
难度 3/5 1-2 天 新手友好度 55/100
OpenAPITools/openapi-diff#957 ·
维护者通常 5 天内回复
查看 OpenAPITools/openapi-diff 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
jenkins-infra/plugin-modernizer-tool#2070 · 1 条评论 ·
维护者通常 1 天内回复
-
Event search answers 500 when calendars, attendees or organizers holds a null element可能重新可做 关联的 PR 已关闭且未合并。 未关闭ai-driven-qa bug Minor
难度 2/5 1-3 小时 新手友好度 70/100
linagora/twake-calendar-side-service#1615 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
eclipse-tradista/tradista#371 ·
维护者通常 1 天内回复
-
critical
难度 2/5 1-3 小时 新手友好度 68/100
mars-sim/mars-sim#2199 · 2 条评论 ·
维护者通常 1 天内回复