Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#515 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Quiet
Tech stack
openapi, python
Domain
api, cli, devtools

Research direction

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.

Written by the indexing model from the issue text.

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.

Dominant language
Python
Stars
409
Forks
73
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from python-openapi/openapi-spec-validator

All issues in python-openapi/openapi-spec-validator

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.