Add specification format selection to `apiops extract` for feature parity with `Azure/apiops`
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 48/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- azure, typescript
- Domínio
- api, cli, documentation
Direção de pesquisa
Comece pelo ponto de entrada apiops extract e leia docs/commands/extract.md e README.md para entender o comportamento existente de --format. Rastreie como os artefatos de especificação extraídos são selecionados e como os formatos de exportação do APIM são representados. O trabalho estará concluído quando os tipos de API compatíveis aceitarem um formato de especificação explícito, o comportamento automático for preservado quando ele for omitido, os casos não compatíveis forem validados e a distinção e as orientações de migração forem documentadas.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Problem or use case
apiops extract currently lets users control the CLI stdout format via --format text|json, but it does not expose a user-facing option to control the exported API specification artifact format itself.
The current docs make this distinction visible:
docs/commands/extract.mddocuments--format <type>only as a global flag for command output (textorjson).- The extract output section describes the artifact tree in general, but there is no documented flag to choose whether an extracted API specification is written as OpenAPI YAML vs JSON when APIM supports both.
This is a migration and usability gap for teams coming from the previous Azure/apiops repository, where specification output format selection was available. In apiops-cli, specification format selection is currently automatic/internal, which makes artifact output less predictable for users who:
- want consistent JSON specs across repositories and environments,
- need JSON for downstream tooling, validation, or transformations,
- want explicit control instead of source-dialect-based auto-selection,
- are migrating existing workflows from
Azure/apiopsand expect the same capability.
The current behavior can also be confusing because --format json sounds like it might affect extracted spec files, but according to the current command documentation it only affects machine-readable command output written to stdout.
Proposed solution
Add a user-facing option to explicitly select the exported API specification artifact format during extraction, while preserving the current automatic behavior as the default.
Suggested behavior:
- Add a dedicated extract flag for specification artifact format selection, for example:
apiops extract --specification-format jsonapiops extract --specification-format yaml
- Scope this flag to API specification artifacts only, not general command output.
- Keep
--format text|jsonunchanged so it continues to mean stdout/log output format only. - When the new specification-format flag is omitted, preserve today's automatic behavior.
- Validate unsupported combinations clearly. For example:
- API types with no specification export should ignore or reject the option with a clear message.
- Formats unsupported by the underlying APIM export path should fail fast with actionable guidance.
- Document the mapping between the new CLI flag and the APIM export formats used internally.
Recommended documentation updates:
- Update
docs/commands/extract.mdto distinguish:--format= stdout format--specification-format= extracted API spec artifact format
- Add examples showing the new flag with
apiops extract - Update migration guidance for users moving from
Azure/apiops - Update artifact format/reference docs so the expected file extension/content is explicit
Suggested acceptance criteria:
- Users can explicitly choose the extracted specification artifact format for supported API types.
- For REST APIs where APIM supports multiple export forms, users can choose JSON vs YAML.
- The selected format controls the written spec artifact consistently.
- Existing extract behavior remains unchanged when the new flag is omitted.
- The docs clearly distinguish stdout formatting from specification artifact formatting.
- Migration documentation calls out this feature as parity with
Azure/apiops.
Relevant current documentation context:
docs/commands/extract.mdshows:--format <type>with valuestextorjson- “Machine-readable JSON output” as stdout behavior
README.mdalso documents--format <type>globally astextorjson- Integration docs already show that the project cares about spec dialect/format fidelity across API types, including:
- REST OpenAPI 3.0 YAML
- REST Swagger 2.0 JSON
- SOAP WSDL
- GraphQL SDL
That existing format awareness makes explicit user selection feel like a natural extension of the current extract model.
Affected command
apiops extract
- Linguagem predominante
- TypeScript
- Estrelas
- 32
- Forks
- 12
- Merge médio
- 2d 14h
- PRs com merge (30d)
- 21
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:question
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Azure/apiops-cli#277 ·
Mantenedores costumam responder em até 1 dia
-
stale type:documentation
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 94/100
Azure/apiops-cli#250 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Documentation P2 stale
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
Azure/apiops-cli#24 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
type:feature
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 55/100
Azure/apiops-cli#316 ·
Mantenedores costumam responder em até 1 dia
-
Named value transitive dependency not being extracted when used only in backend credentials headerTalvez já em andamento @Alexey-Zheltov assumiu há 1 dia. Abertatype:bug
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 66/100
Azure/apiops-cli#315 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
Todas as issues de Azure/apiops-cli
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
JoviDeCroock/pracht#432 ·
Mantenedores costumam responder em até 1 dia
-
Add: CNN en Espanol SDAbertaapproved check:passed streams:add
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
Mantenedores costumam responder em até 1 dia
-
Hardware attribute name "app Connection Support" has inconsistent casingTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Aberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
walletbeat/walletbeat#1628 ·
Mantenedores costumam responder em até 1 dia
-
bug go
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
genkit-ai/genkit#6761 · 1 comentário ·
Mantenedores costumam responder em até 2 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
NousResearch/hermes-agent#136483 ·
Mantenedores costumam responder em até 1 dia