Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

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

Ouverte
#515 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
65/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Calme
Stack technique
openapi, python
Domaine
api, cli, devtools

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
Python
Étoiles
409
Forks
73
Métriques de merge des PR
Aucune PR mergée en 30 j

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de python-openapi/openapi-spec-validator

Toutes les issues de python-openapi/openapi-spec-validator

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.