NAME
pjstruct - JSON-Structure validator CLI for Perl
SYNOPSIS
pjstruct <command> [options] [files...]
# Check a schema is valid
pjstruct check schema.struct.json
# Validate instances against a schema
pjstruct validate -s schema.struct.json data.json
pjstruct validate -s schema.struct.json *.json
# Output formats
pjstruct validate -s schema.struct.json data.json --format=json
pjstruct validate -s schema.struct.json data.json --format=tap
# Quiet mode (exit code only)
pjstruct validate -s schema.struct.json data.json -q
DESCRIPTION
pjstruct is a command-line interface for validating JSON-Structure schemas and validating JSON instances against those schemas.
COMMANDS
- validate, v
-
Validate JSON instance(s) against a schema. Requires
--schemaoption. - check, c
-
Check that schema file(s) are valid JSON-Structure schemas.
- help
-
Show help for a command.
- version
-
Show version information.
OPTIONS
- -s, --schema file
-
Schema file to validate against (required for validate command).
- -f, --format format
-
Output format: text (default), json, or tap.
- -q, --quiet
-
Suppress all output. Use exit code to determine result.
- -v, --verbose
-
Show detailed information including line/column numbers.
- -h, --help
-
Show help.
- -V, --version
-
Show version.
EXIT CODES
- 0
-
Success - all files are valid.
- 1
-
Invalid - one or more files failed validation.
- 2
-
Error - file not found, parse error, or other error.
OUTPUT FORMATS
text (default)
Human-readable output with checkmarks and error details.
✓ data.json: valid
✗ bad.json: invalid
- /name: expected string, got number
json
JSON output suitable for machine processing.
{"file":"data.json","valid":true,"errors":[]}
tap
Test Anything Protocol output, compatible with Perl test harnesses.
1..2
ok 1 - data.json
not ok 2 - bad.json
# /name: expected string, got number
EXAMPLES
# Check multiple schemas
pjstruct check schemas/*.struct.json
# Validate with JSON output for CI
pjstruct validate -s schema.struct.json data.json -f json
# Use in shell scripts
if pjstruct validate -s schema.struct.json data.json -q; then
echo "Valid!"
else
echo "Invalid!"
fi
# Read from stdin
curl -s https://api.example.com/data | pjstruct validate -s schema.struct.json -
SEE ALSO
JSON::Structure, JSON::Structure::SchemaValidator, JSON::Structure::InstanceValidator
AUTHOR
JSON-Structure Contributors
LICENSE
MIT License
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 616:
Non-ASCII character seen before =encoding in '✓'. Assuming UTF-8