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
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 1.1k
- Fork
- 190
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng việc xem xét PathDiff.java, interface ExtensionDiff và phần triển khai XLifecycleExtensionDiff được đề xuất, sau đó kiểm tra các ví dụ pet_source.yaml và pet_target.yaml đính kèm. Theo dõi cách các khác biệt của extension hiện được báo cáo ở các phạm vi schema, path và property. Hoàn thành khi phát hiện được các khác biệt x-lifecycle cho các trường hợp path và properties được mô tả trong issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- api
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 30/100