Skip to content

feat: add JSON Schema for export and status command output#320

Merged
jimisola merged 1 commit intomainfrom
feat/315-json-schema
Mar 12, 2026
Merged

feat: add JSON Schema for export and status command output#320
jimisola merged 1 commit intomainfrom
feat/315-json-schema

Conversation

@jimisola
Copy link
Copy Markdown
Member

Summary

Closes #315

  • Add status_output.schema.json — JSON Schema (draft 2020-12) defining the status --format json output contract
  • Add export_output.schema.json — JSON Schema defining the export command output contract
  • Update codegen and codegen-check scripts in pyproject.toml to exclude *_output.schema.json files from Pydantic model generation
  • Add 20 schema validation tests (meta-schema validity, positive/negative document validation)

Design changes from current output format:

  • Dropped nr_of_ prefix everywhere
  • Nested totals into logical groups (requirements, svcs, tests, automated_tests, manual_tests)
  • Renamed implementationimplementation_type, accessible_nodes_dictimport_graph
  • Renamed annotations_impls/annotations_testsannotations.implementations/annotations.tests
  • Removed internal indexes (svcs_from_req, mvrs_from_svc, etc.) — relationships derivable from object fields
  • Added metadata section with initial_urn and filtered
  • Split revision into structured { major, minor, patch } object

This PR creates the schema specification only. No changes to command code or serialization — implementation deferred to Phase 2 (#313).

Test plan

  • Both schemas pass JSON Schema draft 2020-12 meta-validation
  • Minimal and full example documents validate against schemas
  • Invalid documents correctly rejected (wrong enums, missing required fields, extra fields, negative counts)
  • codegen-check passes (output schemas excluded from Pydantic codegen)
  • Full unit test suite passes (223 tests)

Define the user-facing JSON contract for status and export commands
before the core migration. Output schemas use *_output.schema.json
naming convention and codegen scripts are updated to exclude them.
@jimisola jimisola self-assigned this Mar 12, 2026
@jimisola jimisola merged commit fdc950e into main Mar 12, 2026
6 checks passed
@jimisola jimisola deleted the feat/315-json-schema branch March 12, 2026 13:34
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.

feat: define JSON Schema for export and status command output

1 participant