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 7439fab commit fda683bCopy full SHA for fda683b
scripts/build-schema.ts
@@ -60,9 +60,15 @@ export default async function(
60
}
61
const content = fs.readFileSync(fileName, 'utf-8');
62
63
- const json = JSON.parse(content);
64
- if (!json.$schema) {
65
- // Skip non-schema files.
+ let json;
+ try {
+ json = JSON.parse(content);
66
+ if (typeof json.$schema !== 'string' || !json.$schema.startsWith('http://json-schema.org/')) {
67
+ // Skip non-schema files.
68
+ continue;
69
+ }
70
+ } catch {
71
+ // malformed or JSON5
72
continue;
73
74
const tsContent = await quicktypeRunner.generate(fileName);
0 commit comments