We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 99b97fb commit 382bde1Copy full SHA for 382bde1
dereference.js
@@ -85,12 +85,16 @@ function validateSchemaMeta(schema, schemaVersion) {
85
function detectSchemaVersion(schema) {
86
const schemaUrl = schema.$schema;
87
88
+ if (!schemaUrl) {
89
+ throw new Error('Missing $schema property in the JSON Schema.');
90
+ }
91
+
92
if (schemaUrl.includes('draft/2020-12')) {
93
return '2020-12';
94
} else if (schemaUrl.includes('draft-07')) {
95
return 'draft-07';
96
} else {
- throw new Error('Unsupported or missing $schema property in the JSON Schema.');
97
+ throw new Error('Unsupported $schema property in the JSON Schema: ' + schemaUrl);
98
}
99
100
0 commit comments