`extract` reports extraction errors / exits with code 1 for APIs using `set-body template="liquid"` with `{{ }}` expressions
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
- 58/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ệ
- azure, typescript
Hướng nghiên cứu
Bắt đầu bằng cách chạy lệnh apiops extract được báo cáo trên một chính sách API chứa set-body template="liquid" với các biểu thức {{ }}, sử dụng ghi log gỡ lỗi để theo dõi các lần tra cứu named value. Đi theo đường dẫn trích xuất phân tích các biểu thức chính sách và xác minh rằng các biểu thức Liquid không được xử lý như named values. Hoàn tất khi quá trình trích xuất báo cáo không có lỗi nào và thoát với mã 0 nếu các tài nguyên API được tham chiếu là hợp lệ.
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 --log-level debug --resource-group --service-name --output ./artifacts --filter ./configuration.extractor.yaml --subscription-id --remove-stale
Expected behavior
Extraction completes with exit code 0 for an API whose policy uses set-body template="liquid" to build or transform a request/response body, as long as the API and its real named values/backends actually exist and are reachable.
Actual behavior
The extraction otherwise finishes fine. All APIs, operations, and real named values get written to the output directory. But the run still reports errors and exits with code 1:
[INFO] Extraction complete: 19 resources extracted, 4 errors
With --log-level debug on, I can see the CLI issuing GET .../namedValues/<value> requests where <value> isn't a named value at all. It looks like it was pulled straight out of a {{ ... }} expression inside one of our set-body template="liquid"> blocks:
[DEBUG] HTTP GET https://management.azure.com/.../namedValues/context.Request.MatchedParameters%5B%22id%22%5D?api-version=2025-09-01-preview
[DEBUG] HTTP GET https://management.azure.com/.../namedValues/body.envelope.body.Test_Result.test?api-version=2025-09-01-preview
[DEBUG] HTTP GET https://management.azure.com/.../namedValues/body.envelope.body.fault.faultcode?api-version=2025-09-01-preview
[DEBUG] HTTP GET https://management.azure.com/.../namedValues/body.envelope.body.fault.faultstring?api-version=2025-09-01-preview
None of those are named values in our APIM instance. They're Liquid interpolation expressions from a set-body template="liquid" policy we use to build a SOAP request and reshape the SOAP response into JSON. Each lookup 404s, and each 404 seems to get counted toward the "errors" total. That matches up exactly: 4 Liquid expressions, 4 reported errors. The nonzero exit code then fails our CI pipeline step even though nothing is actually broken or missing.
To work around this we rewrote the affected set-body template="liquid"> blocks as plain C# expressions (<set-body>@{ ... return ...; }</set-body>) instead of Liquid templates. That removed the {{ }} syntax from the policy entirely, and the same extraction now completes with 0 errors and exit code 0. But with the Liquid template the policy would be easier to read and understand.
apiops CLI version
1.0.1
Environment details
- Azure DevOps pipeline, Ubuntu 24.04 hosted agent
- Node.js 24.x
apiops extractinvoked vianpx, with--filterpointing at a YAML filter config- The affected API's policy has three
<set-body template="liquid">blocks: one building a SOAP request body (interpolating a template parameter), and two transforming the SOAP response into JSON (interpolating values pulled out of the parsed SOAP envelope)
CI/CD environment
Azure DevOps
Is this bug blocking you?
No
- Ngôn ngữ chính
- TypeScript
- Star
- 29
- Fork
- 10
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 23
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:question
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Azure/apiops-cli#277 ·
-
type:documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 94/100
Azure/apiops-cli#250 ·
-
Documentation P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Azure/apiops-cli#24 · 1 bình luận ·
-
type:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Azure/apiops-cli#294 ·
-
type:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Azure/apiops-cli#291 ·
Tất cả issue của Azure/apiops-cli
Issue tương tự
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
Mend: dependency security vulnerability untriaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100