Skip to content

Commit 8e9f553

Browse files
authored
fix: allow additional top level fields (#460)
1 parent a273873 commit 8e9f553

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

src/tokenlist.schema.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,6 @@
296296
}
297297
},
298298
"type": "object",
299-
"additionalProperties": false,
300299
"properties": {
301300
"name": {
302301
"type": "string",
@@ -401,4 +400,4 @@
401400
"version",
402401
"tokens"
403402
]
404-
}
403+
}

test/__snapshots__/tokenlist.schema.test.ts.snap

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`schema allows additional top-level fields 1`] = `null`;
4+
35
exports[`schema allows up to 10k tokens 1`] = `null`;
46

57
exports[`schema checks extensions 1`] = `null`;

test/tokenlist.schema.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,12 @@ describe('schema', () => {
136136
};
137137
checkSchema(exampleListWith10kTokensPlusOne, false);
138138
});
139+
140+
it('allows additional top-level fields', () => {
141+
const exampleListWithUnknownField = {
142+
...exampleList,
143+
unknownField: 'foo',
144+
};
145+
checkSchema(exampleListWithUnknownField, true);
146+
});
139147
});

0 commit comments

Comments
 (0)