`extract` reports extraction errors / exits with code 1 for APIs using `set-body template="liquid"` with `{{ }}` expressions
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 58/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- azure, typescript
Direzione di ricerca
Inizia eseguendo il comando segnalato apiops extract su una policy API contenente set-body template="liquid" con espressioni {{ }}, usando il logging di debug per tracciare le ricerche dei named values. Segui il percorso di estrazione che analizza le espressioni della policy e verifica che le espressioni Liquid non vengano trattate come named values. L’attività è completata quando l’estrazione segnala zero errori ed esce con il codice 0 se le risorse API referenziate sono valide.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 29
- Fork
- 10
- Merge medio
- 1g 14h
- PR unite (30g)
- 22
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/apiops-cli
-
type:question
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Azure/apiops-cli#277 ·
-
type:documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 94/100
Azure/apiops-cli#250 ·
-
Documentation P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Azure/apiops-cli#24 · 1 commento ·
-
type:bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
Azure/apiops-cli#291 ·
-
type:feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
Azure/apiops-cli#275 · 2 commenti · 2 reazioni ·
Tutte le issue di Azure/apiops-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
[Bug]: Matrix progress drafts fail with "Matrix runtime not initialized" during tool activity Apertabug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
calcite-components needs triage refactor
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Esri/calcite-design-system#15203 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
danielmiessler/LifeOS#2218 ·