Skip to main content

Reports and Exit Codes

Each linted specification receives a console summary and a detailed report.

Target: specs/orders.yaml
Maturity Level: Silver
Errors: 0, Warnings: 3, Ignored: 1
Status: PASSED

When several specifications are linted, Specmatic also prints aggregate totals.

Report formats

JSON is the default:

docker run --rm \
-v "$(pwd):/usr/src/app" \
-w /usr/src/app \
specmatic/enterprise \
lint specs/orders.yaml

Generate HTML instead:

docker run --rm \
-v "$(pwd):/usr/src/app" \
-w /usr/src/app \
specmatic/enterprise \
lint specs/orders.yaml --format=html

Reports are written below the directory containing the linter configuration:

build/reports/specmatic/lint/openapi/

Filename pattern:

lint-report-<specification-name>.json
lint-report-<specification-name>.html

The command prints each exact report path.

Problem details

Reports identify:

  • rule ID and category;
  • severity and message;
  • source file and JSON Pointer;
  • line and column when available;
  • related source location when applicable;
  • suggested fixes and reference link when supplied; and
  • required maturity level.

Exit codes

CodeMeaningCI result
0No error-level violationsPass
1One or more error-level violationsFail
2Invalid command input or configurationFail

Warnings do not fail the command. This supports gradual adoption: introduce a rule as warn, resolve existing findings, then change it to error.

Measure execution time

docker run --rm \
-v "$(pwd):/usr/src/app" \
-w /usr/src/app \
specmatic/enterprise \
lint "specs/*.yaml" --time

--time prints elapsed time per target and for the complete run.