diff --git a/src/generators/jsonSchema.js b/src/generators/jsonSchema.js index 293ed66..2476cf1 100644 --- a/src/generators/jsonSchema.js +++ b/src/generators/jsonSchema.js @@ -103,13 +103,13 @@ function convertType(fund: Fund, type: ?Type): Schema { }; case 'union': const enumerate = wu(type.variants) - .filter(variant => variant.kind === 'literal') + .filter(variant => variant.kind === 'literal' && variant.value !== null) .map(literal => (literal: $FlowFixMe).value) .tap(value => invariant(value !== undefined)) .toArray(); const schemas = wu(type.variants) - .filter(variant => variant.kind !== 'literal') + .filter(variant => variant.kind !== 'literal' || variant.value === null) .map(variant => convert(fund, variant)) .toArray();