Unify Handling of allOf/anyOf and oneOf in Diff logic
還沒有人認領這個 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
- 分支
- 190
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
- 提供 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 ·
-
good first issue help wanted
難度 2/5 1-3 小時 新手友好度 68/100
OpenAPITools/openapi-diff#364 ·
-
bug OpenAP 3.1.0 Support
難度 3/5 1-2 天 新手友好度 68/100
OpenAPITools/openapi-diff#910 · 1 則留言 ·
-
Render capabilities
難度 3/5 1-2 天 新手友好度 55/100
OpenAPITools/openapi-diff#893 · 1 則留言 ·
-
[Bug] Backward compatibility check fails on reordered discriminator mappings可能已有人在做 @MoChiUaena 於 15 天前認領。 未關閉Breaking/Non-Breaking classification
難度 3/5 1-2 天 新手友好度 55/100
OpenAPITools/openapi-diff#886 ·
查看 OpenAPITools/openapi-diff 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
quelea-projection/Quelea#711 ·
-
bug pdd
難度 2/5 1 小時以內 新手友好度 67/100
objectionary/eo#9450 ·
維護者通常 1 天內回覆
-
[EC2] DescribeAvailabilityZones should return real AWS error for unknown zone name可能已有人在做 @omatheusmesmo 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆
-
area: core good first issue type: enhancement
難度 2/5 1-3 小時 新手友好度 68/100
-
enhancement
難度 2/5 1-3 小時 新手友好度 78/100
ShaftHQ/SHAFT_ENGINE#6909 ·
維護者通常 1 天內回覆