The verify command validates that artifact JSON conforms to the expected structure. This is useful for testing artifact generation or debugging extraction pipelines.
Usage
struktur verify [options]
Options
Path to artifact JSON file, or - to read from stdin (default)
Examples
Verify artifact from file
struktur verify --input artifacts.json
Output:
{
"valid": true,
"artifacts": 3
}
Verify artifact from stdin
cat artifacts.json | struktur verify
Output:
{
"valid": true,
"artifacts": 1
}
Pipeline verification
# Verify artifacts before extraction
struktur verify --input preprocessed.json && \
struktur --artifact preprocessed.json \
--schema schema.json \
--output results.json
Valid artifact JSON must be an array of artifact objects:
[
{
"text": "Document text content",
"media": []
},
{
"text": "More content",
"media": [
{
"type": "image",
"mimeType": "image/png",
"data": "base64-encoded-data"
}
]
}
]
Error handling
Invalid JSON
echo '{invalid}' | struktur verify
Output:
JSON Parse error: Unexpected identifier "invalid"
Invalid artifact structure
echo '{"text": "content"}' | struktur verify
Output:
Invalid artifact format: expected array of artifacts
Exit codes
0 - Artifacts are valid
1 - Invalid JSON or artifact structure