Skip to content

Commit 29c6b39

Browse files
committed
Support optional enums in query string parameters. fix #281
1 parent eff6e20 commit 29c6b39

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/schema-utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function getTypeInfo(parameter, options = { includeNulls: false, enableEx
5050
title: schema.title || '',
5151
description: schema.description || '',
5252
constraints: [],
53-
allowedValues: typeof schema.const !== 'undefined' && [schema.const] || schema.enum || null,
53+
allowedValues: typeof schema.const !== 'undefined' && [schema.const] || schema.enum && [].concat(schema.nullable || !schema.required ? null : []).concat(schema.enum) || null,
5454
arrayType: ''
5555
};
5656

0 commit comments

Comments
 (0)