@@ -25,38 +25,32 @@ cat << 'EOF' > "$TMP/schema.json"
2525EOF
2626
2727" $1 " lint " $TMP /schema.json" --fix 2> " $TMP /stderr.txt" && EXIT_CODE=" $? " || EXIT_CODE=" $? "
28- # Unexpected error
29- test " $EXIT_CODE " = " 1 " || exit 1
28+ # Schema input error
29+ test " $EXIT_CODE " = " 4 " || exit 1
3030
3131cat << EOF > "$TMP /expected.txt"
3232.
33- error: Could not autofix the schema without breaking its internal references
33+ error: The referenced schema is not considered to be a valid subschema given the dialect and vocabularies in use
34+ at identifier file://$( realpath " $TMP " ) /schema.json#/x-\$ defs/not-a-schema
3435 at file path $( realpath " $TMP " ) /schema.json
35- at location "/allOf/0/ \$ ref "
36+ at location "/x- \$ defs "
3637
37- This is an unexpected error, as making the auto-fix functionality work in all
38- cases is tricky. We are working hard to improve the auto-fixing functionality
39- to handle all possible edge cases, but for now, try again without \` --fix/-f\`
40- and apply the suggestions by hand.
41-
42- Also consider consider reporting this problematic case to the issue tracker,
43- so we can add it to the test suite and fix it:
44-
45- https://github.com/sourcemeta/jsonschema/issues
38+ Are you sure the reported location is a valid JSON Schema keyword in this dialect?
4639EOF
4740
4841diff " $TMP /stderr.txt" " $TMP /expected.txt"
4942
5043# JSON error
5144" $1 " lint " $TMP /schema.json" --fix --json > " $TMP /stdout.txt" && EXIT_CODE=" $? " || EXIT_CODE=" $? "
52- # Unexpected error
53- test " $EXIT_CODE " = " 1 " || exit 1
45+ # Schema input error
46+ test " $EXIT_CODE " = " 4 " || exit 1
5447
5548cat << EOF > "$TMP /expected.txt"
5649{
57- "error": "Could not autofix the schema without breaking its internal references",
50+ "error": "The referenced schema is not considered to be a valid subschema given the dialect and vocabularies in use",
51+ "identifier": "file://$( realpath " $TMP " ) /schema.json#/x-\$ defs/not-a-schema",
5852 "filePath": "$( realpath " $TMP " ) /schema.json",
59- "location": "/allOf/0/ \$ ref "
53+ "location": "/x- \$ defs "
6054}
6155EOF
6256
0 commit comments