Commit 78bd3a51 authored by nanahira's avatar nanahira

fix required field

parent 47da8a85
...@@ -36,7 +36,7 @@ function swaggerDecorator( ...@@ -36,7 +36,7 @@ function swaggerDecorator(
) { ) {
return ApiProperty({ return ApiProperty({
default: options.default, default: options.default,
required: options.required && options.default == null, required: !!(options.required && options.default == null),
example: options.default, example: options.default,
description: options.description, description: options.description,
...injected, ...injected,
...@@ -192,6 +192,9 @@ export const NotColumn = ( ...@@ -192,6 +192,9 @@ export const NotColumn = (
): PropertyDecorator => ): PropertyDecorator =>
MergePropertyDecorators([ MergePropertyDecorators([
Exclude(), Exclude(),
swaggerDecorator(options), swaggerDecorator({
required: false,
...options,
}),
Metadata.set('notColumn', true, 'notColumnFields'), Metadata.set('notColumn', true, 'notColumnFields'),
]); ]);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment