`Bundle` writes `components.pathItems` into OpenAPI 3.0 documents
Maintainer thường phản hồi trong vòng 1 ngày
Một pull request liên quan đã được merge.
- #286 của @TristanSpeakEasy — đã merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 83/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go, openapi
- Lĩnh vực
- backend-api-design
Hướng nghiên cứu
Bắt đầu với openapi/bundle.go, nơi bundleObject gửi các mục đường dẫn được tham chiếu đến bundleGenericReference với tên thành phần pathItems. Kiểm tra cách mã bundle xác định phiên bản OpenAPI và tìm các bài kiểm thử bundle hiện có bao phủ các mục đường dẫn được tham chiếu. Với OpenAPI 3.0, mục đường dẫn phải xuất hiện trực tiếp bên dưới paths; xác nhận tài liệu được bundle không còn thêm components.pathItems.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
For an OpenAPI 3.0 document, openapi.Bundle (and openapi spec bundle) moves a path item that lives in another file into components.pathItems. That field was added in 3.1: the 3.0 Components Object has no pathItems (its fixed fields are schemas, responses, parameters, examples, requestBodies, headers, securitySchemes, links and callbacks), so the bundled document is no longer valid 3.0.
Reproduction
openapi.yaml:
openapi: 3.0.3
info: {title: t, version: "1"}
paths:
/items:
$ref: ./paths/items.yaml
paths/items.yaml:
get:
responses:
"200":
description: ok
$ openapi spec bundle openapi.yaml
openapi: 3.0.3
info: {title: t, version: "1"}
paths:
/items:
$ref: '#/components/pathItems/items'
components:
pathItems:
items:
get:
responses:
"200":
description: ok
Expected result
A valid 3.0 document: with nowhere in 3.0 components to hold it, the path item written inline under paths./items. redocly bundle does this for the same input.
Actual result
components.pathItems in a 3.0.3 document. vacuum's oas3-schema rule rejects it (schema invalid: `/components` additional properties not allowed: `[pathItems]` ), while openapi spec validate reports it valid.
Version
v1.26.0 (also main, d269643). CLI from go install github.com/speakeasy-api/openapi/cmd/openapi@latest (v0.0.0-20261016011534-d2696438ec74).
Cause
bundleObject sends every ReferencedPathItem to bundleGenericReference(..., "pathItems") (openapi/bundle.go:199) whatever the document's openapi version.
- Ngôn ngữ chính
- Go
- Star
- 276
- Fork
- 21
- Merge trung bình
- 1 ngày 6 giờ
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
lognorman20/monaco#7428 ·
-
docs(prompts): IF BLOCKED workflow-scope branch says to comment on the issue on jira/local trackersĐang mởagent-butler-finding bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 77/100
jordansmall/spindrift#6238 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: microcks test get swallows test failure details and operation results in text output modeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
microcks/microcks-cli#608 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug from-studio
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
esengine/DeepSeek-Reasonix#14868 ·
Maintainer thường phản hồi trong vòng 1 ngày