Skip to content

Generate commands.schema.json for per-command success validation#311

Merged
AndreyVMarkelov merged 1 commit into
masterfrom
feat/command-success-schema
Jun 29, 2026
Merged

Generate commands.schema.json for per-command success validation#311
AndreyVMarkelov merged 1 commit into
masterfrom
feat/command-success-schema

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Generates docs/json-schema/v1/commands.schema.json (JSON Schema 2020-12) from commands.json — validates per-command success responses including envelope fields, result status/kind enums, warning codes, and field sets
  • Adds internal/jsonschema package with GenerateCommandSuccessSchema for deterministic schema generation
  • Adds tools/gen-json-schemas tool with CI drift detection
  • Adds schema_refs.command_success_schema to each manifest pointing to the per-command definition
  • Tests validate all golden outputs against the generated schema and verify rejection of invalid data

Test plan

  • go test ./... passes
  • golangci-lint run ./... clean
  • gofmt -s -l . clean
  • TestPublicJSONCommandSuccessSchemaMatchesGeneratedCatalog — drift detection
  • TestGoldenSuccessOutputsValidateAgainstPublicCommandSuccessSchema — validates all golden outputs
  • TestPublicCommandSuccessSchemaRejectsInvalidStatus — verifies schema catches invalid data
  • CI runs gen-json-schemas and checks for drift
  • Generated docs rebuilt and in sync

Adds a JSON Schema 2020-12 file generated from commands.json that
validates command-specific success responses: envelope fields, result
status/kind enums, warning codes, and field sets. CI verifies the schema
stays in sync via gen-json-schemas, and tests validate all golden outputs
against it.
@AndreyVMarkelov AndreyVMarkelov force-pushed the feat/command-success-schema branch from 2f4c6ee to 2fb60b3 Compare June 29, 2026 21:19
@AndreyVMarkelov AndreyVMarkelov merged commit f9a5806 into master Jun 29, 2026
8 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