Changes reported in operations but only securityScheme changed

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

@Inf1mum đang làm issue này rồi.

Từ ngày 7/11/2026.

  • #933 của @Inf1mum — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
55/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
java
Lĩnh vực
api

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện báo cáo với hai tài liệu OpenAPI 3.1 được hiển thị và dependency openapi-diff-core 2.1.6. Theo dõi cách các thay đổi đối với authorizationUrl và tokenUrl của OAuth2 securityScheme được gán cho POST /users, sau đó cập nhật vị trí thay đổi được báo cáo và xác minh rằng thông báo kết quả xác định thay đổi của security-scheme.

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

Mô tả

Render capabilities

I am using

    testImplementation("org.openapitools.openapidiff:openapi-diff-core:2.1.6") {
        exclude(group = "io.swagger.core.v3", module = "swagger-core")
        exclude(group = "io.swagger.core.v3", module = "swagger-models")
        exclude(group = "io.swagger.core.v3", module = "swagger-annotations")
    }

Given the two API docs to compare where the only change is in authorizationUrl ('' vs. 'some_value') and tokenUrl ('' vs. 'some_value').

First file
components:
  securitySchemes:
    OAuth2:
      bearerFormat: JWT
      flows:
        authorizationCode:
          authorizationUrl: ''
          tokenUrl: ''
      in: header
      scheme: bearer
      type: oauth2
info:
  title: Company API
  version: V0
openapi: 3.1.0
paths:
  /users:
    post:
      operationId: createUser
      responses:
        "201":
          description: Created
      security:
      - OAuth2: []
servers:
- description: Default Server URL
  url: /api/
Second file
components:
  securitySchemes:
    OAuth2:
      bearerFormat: JWT
      flows:
        authorizationCode:
          authorizationUrl: 'some_value'
          tokenUrl: 'some_value'
      in: header
      scheme: bearer
      type: oauth2
info:
  title: Company API
  version: V0
openapi: 3.1.0
paths:
  /users:
    post:
      operationId: createUser
      responses:
        "201":
          description: Created
      security:
      - OAuth2: []
servers:
- description: Default Server URL
  url: /api/

The resulting error message is misleading as the issue is not directly related to any concrete endpoint. This took me quite a while to narrow this down to this difference.

So it would be nice to have a more suitable error message.

org.opentest4j.AssertionFailedError: [### Company API (v V0)
---

#### What's Changed
---

##### `POST` /users


#### Result
---

API changes broke backward compatibility

] 
Ngôn ngữ chính
Java
Star
1.1k
Fork
191
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

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.

Issue khác của OpenAPITools/openapi-diff

Tất cả issue của OpenAPITools/openapi-diff

Issue tương tự

Thêm issue về Java

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.