Skip to content

Commit 5839897

Browse files
committed
add clarification
1 parent ef826a4 commit 5839897

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/build-schema.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ const ref = id => ({ $ref: `#/definitions/${id}` });
1616

1717
const $optional = Symbol('optional');
1818
const optional = schema => ({ ...schema, [$optional]: true });
19+
20+
// Older compiler versions returned null for missing fields, whereas newer
21+
// releases omit them. Generally `optional` should be used instead of `nullable`.
1922
const nullable = schema => schema ? optional(anyOf(schema, _null)) : optional(_null);
2023

2124
const object = (properties = {}) => ({

0 commit comments

Comments
 (0)