InvalidSampleJSONError
The Cause
Section titled “The Cause”A sample file contains invalid JSON and cannot be parsed. Sample files must be valid JSON documents.
This can happen when:
- The file was manually edited and contains syntax errors
- The file was corrupted
- The file was partially written due to an interrupted generation
Common JSON syntax errors:
// ❌ Trailing comma{ "foo": "bar",}
// ❌ Single quotes instead of double quotes{ 'foo': 'bar'}
// ❌ Unquoted keys{ foo: "bar"}
// ✅ Valid JSON{ "foo": "bar"}The Solution
Section titled “The Solution”To fix this:
- Validate the JSON file using a JSON validator
- Fix any syntax errors
- Or regenerate the samples:
thymian sampler:init --overwrite