Skip to content

Conversation

@clemensv
Copy link
Contributor

@clemensv clemensv commented Dec 8, 2025

Adds \jstruct, a command-line tool for validating JSON Structure schemas and instances.

Features

  • **\jstruct check**: Validate JSON Structure schema files
  • **\jstruct validate**: Validate JSON instances against a schema
  • Multiple output formats: text (default), JSON, TAP
  • Exit codes: 0 = valid, 1 = invalid, 2 = error

Builds

The workflow builds binaries for:

  • Linux x86_64 / ARM64
  • Windows x86_64 / ARM64
  • macOS x86_64 (Intel) / ARM64 (Apple Silicon)

Packaging

  • DEB packages (Debian/Ubuntu)
  • RPM packages (RHEL/Fedora)
  • Homebrew formula (macOS)
  • Chocolatey package (Windows)
  • PowerShell installer (Windows)
  • Shell installer (Linux/macOS)

Usage

\\�ash

Check a schema

jstruct check schema.struct.json

Validate an instance

jstruct validate --schema schema.json data.json

JSON output

jstruct check --format json schema.json
\\

Tests

17 CLI-specific tests covering all commands and options.

Clemens Vasters added 7 commits December 8, 2025 06:49
- Add jstruct binary with check and validate commands
- Support text, JSON, and TAP output formats
- Add quiet mode for CI usage
- Support extended validation mode
- Exit codes: 0=valid, 1=invalid, 2=error
- Add CLI integration tests (17 tests)
- Add clap, tempfile dependencies
- Update README with CLI documentation
- Add -b/--bundle option to both check and validate commands
- Bundle schemas are loaded and used as external_schemas for  resolution
- When bundles are provided, allow_import is enabled automatically
- Update CLI.md documentation with bundle option and usage examples
- Add test-binaries job that downloads and tests built artifacts
- Tests run on native platforms: Linux x64, Windows x64, macOS Intel & ARM
- Smoke tests include: --version, --help, check/validate commands
- Tests valid schema, invalid schema (exit 1), valid/invalid instances
- Tests JSON and TAP output formats, multiple files, quiet mode
- Release job now depends on test-binaries passing
- Use validation schemas instead of non-existent valid directory
- Use stdin for instance validation tests instead of missing instance files
- Test with numeric-minimum-with-uses.struct.json (valid schema)
- Test with missing-type.struct.json (invalid schema)
The minimum constraint requires  and extended validation mode.
Type mismatch (string vs int32) is a core validation that always works.
@clemensv clemensv merged commit b8cd0f6 into master Dec 8, 2025
36 checks passed
@clemensv clemensv deleted the jstruct-cli branch December 8, 2025 07:16
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.

2 participants