OpenAPITools / OpenAPITools/openapi-diff

Comparing OpenAPI 3.0.1 to 3.1.0 does not work

Đang mở
#755 5 bình luận 1 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

OpenAP 3.1.0 Support
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ả

When running a comparison between OpenAPI 3.0.1 and 3.1.0 via Docker, it looks like everything is reported as different.

Suppressing the details gives this:

$ docker run --rm -t -v .:/specs:ro  openapitools/openapi-diff /specs/api-docs-301.json /specs/api-docs-310.json --state
incompatible

ℹ Please note that those spec files are identical, only the initial OpenAPI version differs:

  • "openapi": "3.0.1"
  • "openapi": "3.1.0"

Comparing two specs with OpenAPI 3.1.0 seems to work as desired. ✅

I used latest which appears to be 6 weeks old - cannot get the version from the tool itself 🤷


Running the same via openapi-diff installed from brew shows a different error:

$ openapi-diff api-docs-301.json api-docs-310.json 
Unexpected exception. Reason: Cannot read new OpenAPI spec
java.lang.RuntimeException: Cannot read new OpenAPI spec
        at org.openapitools.openapidiff.core.OpenApiCompare.notNull(OpenApiCompare.java:107)
        at org.openapitools.openapidiff.core.OpenApiCompare.fromSpecifications(OpenApiCompare.java:102)
        at org.openapitools.openapidiff.core.OpenApiCompare.fromLocations(OpenApiCompare.java:91)
        at org.openapitools.openapidiff.cli.Main.main(Main.java:174)

But this also does not work with two OpenAPI 3.1.0 specs:

$ openapi-diff api-docs-310.json api-docs-310.json 
Unexpected exception. Reason: Cannot read old OpenAPI spec
java.lang.RuntimeException: Cannot read old OpenAPI spec

Brew shows this to be version 2.0.1 - cannot get the version from the tool itself.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với điểm vào CLI trong Main.java và đường dẫn tải specification trong OpenApiCompare.java, đặc biệt là các lệnh gọi được hiển thị trong stack trace. Tái hiện các lệnh Docker và brew với các tài liệu giống hệt nhau ở phiên bản 3.0.1 và 3.1.0, sau đó so sánh hành vi của chúng. Hoàn thành khi các phép so sánh hợp lệ hoạt động giữa các phiên bản này mà không báo cáo các tài liệu giống hệt nhau là không tương thích hoặc thất bại khi đọc chúng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
docker, java, openapi
Lĩnh vực
api, backend-api-design
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
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.