Filter unused OpenAPI definitions when extracting selected operations
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- openapi, typescript
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 44
- Fork
- 14
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi 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:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
Azure/apiops-cli#350 ·
-
stale
Difficoltà 1/5 1-3 ore Idoneità per principianti 84/100
Azure/apiops-cli#333 · 1 commento ·
-
extract fails when a policy uses set-backend-service backend-id="{{namedValue}}"Forse già presa @dannyward630 l’ha presa 37 giorni fa. Apertastale type:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Azure/apiops-cli#331 · 1 commento ·
-
Docs example says products are auto-included transitively, but they aren't extracted with `products: []`Forse già presa @cdayne l’ha presa 27 giorni fa. Apertastale type:question
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Azure/apiops-cli#277 · 1 commento ·
-
Extractor mistakes set-body json response as transitive dependency which causes pipeline failureApertatype:bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 56/100
Azure/apiops-cli#349 ·
Tutte le issue di Azure/apiops-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
tashfeenahmed/freellmapi#2217 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 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 linesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Slider: Escape during a thumb drag keeps and commits the dragged value, unlike ui-sdk's other dragsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
vercel-labs/ui#1758 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nicobailon/pi-subagents#3425 ·
I maintainer di solito rispondono entro 1 giorno