Filter unused OpenAPI definitions when extracting selected operations
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- openapi, typescript
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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
- Linguagem predominante
- TypeScript
- Estrelas
- 44
- Forks
- 14
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de Azure/apiops-cli
-
type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 71/100
Azure/apiops-cli#350 ·
-
stale
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 84/100
Azure/apiops-cli#333 · 1 comentário ·
-
extract fails when a policy uses set-backend-service backend-id="{{namedValue}}"Talvez já em andamento @dannyward630 assumiu há 37 dias. Abertastale type:bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Azure/apiops-cli#331 · 1 comentário ·
-
Docs example says products are auto-included transitively, but they aren't extracted with `products: []`Talvez já em andamento @cdayne assumiu há 27 dias. Abertastale type:question
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Azure/apiops-cli#277 · 1 comentário ·
-
Extractor mistakes set-body json response as transitive dependency which causes pipeline failureAbertatype:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 56/100
Azure/apiops-cli#349 ·
Todas as issues de Azure/apiops-cli
Issues semelhantes
-
area:api bug good first issue priority:high
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Doezer/Questarr#1486 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area:import difficulty:good-first good first issue help wanted priority:P1 roadmap size:S type:test
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
Sergey-Bar/Penny#245 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
mihazs/lazysh#3377 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Approve the Cloudflare agent plugin for harness sessionsTalvez já em andamento @joshtsch assumiu hoje. Abertaenhancement ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia