OpenAPITools / OpenAPITools/openapi-diff
The current openapi-diff implementation does not capture differences in extensions that occur at the properties level (attributes under the type object) and the path level
还没有人认领这个 Issue。
- 主要语言
- Java
- 星标
- 1.1k
- 派生
- 190
- PR 合并指标
- 30 天内没有已合并 PR
描述
Discussed in https://github.com/OpenAPITools/openapi-diff/discussions/603
Originally posted by rupeshkumarmall December 28, 2023
I have two *.yaml files named pet_source.yaml and pet_target.yaml. The requirement is to identify the differences between the source and target files specifically related to the extension "x-lifecycle."
The extension "x-lifecycle" is utilized in lines 15, 18, 20, and 92 within the pet_source.yaml file. Currently, the implementation can detect the differences concerning the extension only for the differences found in lines 15 and 20 (between source and target schema), but not for the other two instances (when used under the path and the properties scope). However, it should be functioning, at the very least, for the path, as PathDiff.java incorporates ExtensionDiff.
To enhance the implementation, ### can we extend it by introducing the PropertiesDiff.java and ChangedProperties.java classes, along with other necessary modifications in the core implementation, to recognize differences at the property level as well (solely concerning the "x-lifecycle" extension)?
By the way, I have already added another diff implementation that identifies the difference w.r.t the extension "x-lifecycle" as mentioned below,
public class XLifecycleExtensionDiff implements ExtensionDiff
Also added a file under resources directory, openapi-diff-2.0.1\core\src\main\resources\META-INF\services\org.openapitools.openapidiff.core.compare.ExtensionDiff with the content "org.openapitools.openapidiff.core.compare.XLifecycleExtensionDiff"
Attaching the source & the target file,
sample_yaml_for_diff.zip
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先检查 PathDiff.java、ExtensionDiff 接口以及提议的 XLifecycleExtensionDiff 实现,然后检查随附的 pet_source.yaml 和 pet_target.yaml 示例。跟踪扩展差异目前是如何在 schema、path 和 property 作用域进行报告的。当能够检测出 issue 中描述的 path 和 properties 情况下的 x-lifecycle 差异时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- java
- 领域
- api
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100