Skip to content

Commit 6ec10b8

Browse files
pick default or 0 whichever
1 parent 6958dab commit 6ec10b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/jsonSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ const fromJsonSchemaArray = (fieldValue: SupportedJSONSchema4, optionalFieldList
9696
if (!fieldValue.items.properties.unit.enum) {
9797
throw new UnsupportedJsonSchemaError('Unit enum is not defined');
9898
}
99-
const unit = fieldValue.items.properties.unit.enum[0];
99+
const unit = fieldValue.items.properties.unit.default || fieldValue.items.properties.unit.enum[0];
100100
const isAdjustedToUTC = !!fieldValue.items.properties.isAdjustedToUTC.default;
101101
let timeUnit: TimeUnit;
102102

0 commit comments

Comments
 (0)