Are these OpenAPI 3 paths ambiguous?
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- openapi
- Lĩnh vực
- api, documentation
Hướng nghiên cứu
Đọc phần Paths Object trong versions/3.0.0.md và so sánh các quy tắc khớp của phần này với các ví dụ /shops/{shopId}/pets/{petId} và /shops/{shopId}/pets/_search trong issue này. Xem lại phần thảo luận hiện có trước khi quyết định liệu văn bản có cần một định nghĩa hay một ví dụ bổ sung hay không. Công việc được xem là hoàn tất khi các maintainer đồng ý với cách diễn đạt đặc tả đã được làm rõ và phần liên quan được cập nhật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
As suggested by @MikeRalphson on Stackoverflow, I'm asking the question here as well.
Are those OpenAPI 3 paths ambiguous?
/shops/{shopId}/pets/{petId}
/shops/{shopId}/pets/_search
I want to answer no but, strictly reading the spec, I can't decide because they seem to fall into none of the 3 statements made by the spec:
- Neither path is concrete (term used in the spec)
- Paths don't seem to meet the Templated paths with the same hierarchy but different templated names criteria (that is not very clear to me, here is my understanding:
"/shops/{}/pets/{}" != "/shops/{}/pets/_search") - Paths do not look like the ambiguous example
In addition to the question asked on Stackoverflow, let me ask two additional questions (below).
Should the OA3 spec be improved?
@MikeRalphson's reading of the spec: path are not ambiguous because one is more concrete than the other.
If paths are indeed not ambiguous, then the more concrete notion might need to be defined.
How could the OA3 spec be improved?
We might add an example like this:
Assuming paths sharing a common and identical prefix,
/shops/{shopId}/pets, the more concrete definition,/shops/{shopId}/pets/_search, will be matched first if used:/shops/{shopId}/pets/{petId} /shops/{shopId}/pets/_search
Or we might only show minimalistic examples involving templated names, and say that they also apply in case of common and identical prefixes:
First statement (concrete vs template case):
/{otherPlace} /here
Second statement (considered identical and invalid):
/{id} /{name}
Third statement is left unchanged (ambiguous resolution):
/{entity}/me /books/{id}
Related excerpt of the OA3 spec
The "Paths object" paragraph of the OpenAPI 3 specification (https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.0.md#paths-object) is stating (3 sentences, 3 statements):
When matching URLs, concrete (non-templated) paths would be matched before their templated counterparts. Templated paths with the same hierarchy but different templated names MUST NOT exist as they are identical. In case of ambiguous matching, it's up to the tooling to decide which one to use.
Those 3 statements are followed by 3 examples (and that's it):
Assuming the following paths, the concrete definition,
/pets/mine, will be matched first if used:/pets/{petId} /pets/mineThe following paths are considered identical and invalid:
/pets/{petId} /pets/{name}The following may lead to ambiguous resolution:
/{entity}/me /books/{id}
- Ngôn ngữ chính
- Markdown
- Star
- 31.2k
- Fork
- 9.2k
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc 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.
Issue khác của OAI/OpenAPI-Specification
-
Housekeeping
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 45/100
OAI/OpenAPI-Specification#5566 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Housekeeping
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 35/100
OAI/OpenAPI-Specification#5562 · 4 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Housekeeping
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 10/100
OAI/OpenAPI-Specification#5556 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
v3.2.1 releaseCó thể làm lại được @lornajane đã nhận 31 ngày trước và không có pull request nào đang mở. Đang mở
OAI/OpenAPI-Specification#5460 · 11 bình luận · 1 reaction · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
param serialization
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
OAI/OpenAPI-Specification#5366 · 12 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của OAI/OpenAPI-Specification
Issue tương tự
-
[Anon] Imperium - Adeptus Astartes - Dark Angels: Aggressors Autostorm Bolter Gauntlets IncorrectĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
GreedyBear-Project/GreedyBear#1727 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
modusensus/dsh-mneme#411 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ARM-software/CMSIS-DSP#354 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
Maintainer thường phản hồi trong vòng 1 ngày