Skip to content

Commit 7f838c2

Browse files
Release v1.37.2
1 parent 15d07cb commit 7f838c2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

shared/uploader/annotations-parsing-shared/parse-label-json.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ export type JsonSchemaConstraint = {
4848
} | {
4949
type: 'any';
5050
required?: boolean;
51+
} | {
52+
type: 'null';
53+
required?: boolean;
5154
} | {
5255
type: 'either';
5356
required?: boolean;
@@ -116,6 +119,12 @@ export function validateJsonSchema(schema: JsonSchemaConstraint, instance: objec
116119
};
117120
}
118121

122+
if (constraint.type === 'null' && io === null) {
123+
return {
124+
valid: true
125+
};
126+
}
127+
119128
// If type 'either', check we have any valid match
120129
if (constraint.type === 'either') {
121130
for (const possibleConstraint of constraint.possibleTypes) {

0 commit comments

Comments
 (0)