Filter unused OpenAPI definitions when extracting selected operations
Chưa có ai nhận issue này.
Đá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
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- openapi, typescript
Hướng nghiên cứu
Start at the apiops extract command in the TypeScript CLI source and trace where the --filter operation selection prunes paths before the spec is written to specification.yaml. The fix belongs after paths are filtered: collect the $ref targets reachable from the remaining operations and keep only those components/definitions, walking transitively so shared schemas and nested items survive. Validate with an extracted spec containing an invalid definition used only by an excluded operation, then run it through Spectral — done means Spectral no longer reports errors from unreferenced definitions.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Command that triggered the bug
apiops extract
Expected behavior
When extracting an API with an operation filter, the generated OpenAPI specification contains only the selected operations, but retains definitions used exclusively by excluded operations.
This can cause validation to fail on an unrelated definition. For example, Spectral reports an array-items error for an invalid schema even when the operation using it was excluded.
Expected behavior
Filter the definitions to those needed by the selected operations, while preserving all transitively referenced components.
Actual behavior
The extractor removes unselected operations from specification.yaml, but still extracts definitions that are not referenced by the selected operations. As a result, validation can fail on an invalid definition unrelated to the selected operations.
apiops CLI version
1.0.5
Environment details
Environment
APIOps CLI: 1.0.5
Command: apiops extract --filter
CI: Azure DevOps with Spectral validation
CI/CD environment
None
Is this bug blocking you?
Yes
- Ngôn ngữ chính
- TypeScript
- Star
- 44
- Fork
- 14
- 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
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không 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 Azure/apiops-cli
-
type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
Azure/apiops-cli#350 ·
-
stale
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 84/100
Azure/apiops-cli#333 · 1 bình luận ·
-
extract fails when a policy uses set-backend-service backend-id="{{namedValue}}"Có thể đã có người làm @dannyward630 đã nhận 37 ngày trước. Đang mởstale type:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Azure/apiops-cli#331 · 1 bình luận ·
-
Docs example says products are auto-included transitively, but they aren't extracted with `products: []`Có thể đã có người làm @cdayne đã nhận 27 ngày trước. Đang mởstale type:question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/apiops-cli#277 · 1 bình luận ·
-
Extractor mistakes set-body json response as transitive dependency which causes pipeline failureĐang mởtype:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 56/100
Azure/apiops-cli#349 ·
Tất cả issue của Azure/apiops-cli
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
tashfeenahmed/freellmapi#2217 ·
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 67/100
remotion-dev/skills#37 ·
-
gui: a narrow window's gateway key row with a line under it wraps its faded badges onto blank linesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
Slider: Escape during a thumb drag keeps and commits the dragged value, unlike ui-sdk's other dragsĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
vercel-labs/ui#1758 ·
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 70/100
nicobailon/pi-subagents#3425 ·
Maintainer thường phản hồi trong vòng 1 ngày