InvalidSpecification raised for OperationId

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

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
openapi, python
Lĩnh vực
api, backend-api-design

Hướng nghiên cứu

Reproduce the regression with the conflicting paths in openapi.yaml and inspect the duplicate OperationId validation introduced while resolving issue #96. Compare the behavior in version 0.3.0 with the controller-qualified operation IDs described here. Done means the intended uniqueness behavior is established and the breaking-change or compatibility behavior is covered and documented.

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

Mô tả

The resolution for issue #96 (duplicated OperationID not detected) introduced a breaking-change or regression. Upon updating dependencies to version 0.3.0, the connexion library now reports this error when I run my longstanding openapi.yaml:

connexion.exceptions.InvalidSpecification: Operation ID 'find' for 'get' in '/apikey' is not unique

Each of my path prefixes refers to a different x-openapi-router-controller class; because they share similar logic, I use the same operationId function name for methods like get/find/delete for each of the controllers.

Shouldn't the duplicate detection logic look for a uniqueness across both x-openapi-router-controller and operationId? If my openapi.yaml file needs updating (due to a change in the standard, or my misunderstanding of the standard), then this breaking-change needs to be called out clearly in changelog / release notes.

I'd like it to handle this use-case; for now I'll adjust openapi.yaml to handle this new behavior in 0.3.0 but this could be a huge headache for other users. Perhaps you should add a compatibility flag for such users to transition between now and the next release.

Below is an example of conflicting paths:

/apikey:
  get:
    summary: Find APIkeys by conditions
    operationId: find
    parameters:
    - description: APIkey ID
      ...
    responses:
      200:
      ...
    x-openapi-router-controller: controllers.apikey.APIkeyController
/message:
  get:
    summary: Find messages by conditions
    operationId: find
    parameters:
    - description: Message ID
      ...
    responses:
      200:
      ...
    x-openapi-router-controller: controllers.message.MessageController
Ngôn ngữ chính
Python
Star
409
Fork
73
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

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.

Issue khác của python-openapi/openapi-spec-validator

Tất cả issue của python-openapi/openapi-spec-validator

Issue tương tự

Thêm issue về Python

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.