Skip to content

Add warnings array to JSON error responses - #278

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
json-output-warnings
Jun 24, 2026
Merged

Add warnings array to JSON error responses#278
AndreyVMarkelov merged 1 commit into
masterfrom
json-output-warnings

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a warnings field (always [] for now) to jsonErrorResponse to reserve the schema for future machine-actionable warnings
  • Introduces shared jsonOperationOutput/jsonOperationResult types for future consolidation of per-command JSON output structs
  • Normalizer helpers ensure null never appears in JSON output (always [] or {})
  • Updates README to document the warnings field in error responses

Test plan

  • All existing tests pass
  • New tests verify warnings is always an empty array (not null) in error responses
  • New tests verify newJSONOperationOutput normalizes nil inputs/results/warnings
  • gofmt, go vet, golangci-lint clean

Include a warnings array in JSON error responses so the schema has a stable place for future machine-actionable warnings.

Add shared JSON operation output/result types for future consolidation of command-specific JSON payloads, and document the stdout/stderr contract.
@AndreyVMarkelov
AndreyVMarkelov merged commit db66e83 into master Jun 24, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant