Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

feat: add --json / --output-format=json flag for structured error output in CI pipelines

Aberta
#515 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
65/100
Tipo de issue
Funcionalidade
Clareza
Claramente especificada
Status de atividade
Pouca atividade
Stack de tecnologia
openapi, python
Domínio
api, cli, devtools

Direção de pesquisa

Look at the existing CLI output formatters in the codebase, likely in a module like openapi_spec_validator/cli.py or openapi_spec_validator/formatters.py. Study how spectral and vacuum implement JSON output. The first step is to add a --format json argument to the CLI parser and create a new formatter class that outputs structured error objects with the specified fields. Test by running the validator on a sample spec and verifying the JSON output is valid and contains the expected keys.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

The CLI currently outputs human-readable error messages, which works well for interactive use but is harder to parse in CI/CD pipelines or editor integrations.

Issue #160 ("No specific error information available", open since 2022) highlights how vague error messages make debugging difficult. A structured JSON output mode would solve this by emitting parseable error objects with:

  • path: the location in the spec where the error occurred
  • message: human-readable description
  • rule: the specification rule that was violated (e.g. openapi.3.1.schema-validation)
  • severity: error / warning / info
  • suggestion: (optional) guidance on how to fix

This could be activated via --format json or controlled through the Python API by passing a structured formatter. Existing validators like spectral (--format json) and vacuum already support this pattern.

The openapi-core ecosystem would also benefit — consumers like prism or openapi-core could consume structured validation results without string-parsing output.

Linguagem predominante
Python
Estrelas
409
Forks
73
Métricas de merge de PRs
Nenhum PR com merge em 30d

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de python-openapi/openapi-spec-validator

Todas as issues de python-openapi/openapi-spec-validator

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.