Usage
Table of Contents
Basic syntax: java -jar yj-schema-validator.jar [options] [<file1> <file2> …]
If no files are provided, or if - is used as a filename, the tool reads from stdin.
1. Quick Start
Validate a single file (assumes schema in file’s $schema):
java -jar yj-schema-validator.jar config.yaml
Validation Result: ok
config.yaml: ok
With explicit schema:
java -jar yj-schema-validator.jar config.yaml --schema=schema.json
Validate from stdin:
cat config.yaml | java -jar yj-schema-validator.jar --schema=schema.json
Batch with JUnit report (for CI):
java -jar yj-schema-validator.jar *.yaml --schema=schema.json --report-type=junit --report-file-name=report.xml
2. CI/CD Integration Example (GitHub Actions)
- name: Validate Schemas
run: |
curl -L -o yj-schema-validator.jar https://repo1.maven.org/maven2/org/alexmond/yj-schema-validator/2.0.2/yj-schema-validator-2.0.2.jar
java -jar yj-schema-validator.jar config/*.yaml --schema=schema.json --report-type=junit --report-file-name=report.xml
# Use actions like 'dorny/test-reporter' to publish report.xml