Skip to content

Commit 07c67b5

Browse files
author
Simon Tsvilik
committed
feat: add support for union/enum types for @formfield()
1 parent 9c6e2b2 commit 07c67b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/cli/src/metadataGeneration/parameterGenerator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export class ParameterGenerator {
280280

281281
private getFormFieldParameter(parameter: ts.ParameterDeclaration): Tsoa.Parameter {
282282
const parameterName = (parameter.name as ts.Identifier).text;
283-
const type: Tsoa.Type = { dataType: 'string' };
283+
const type = this.getValidatedType(parameter);
284284

285285
if (!this.supportPathDataType(type)) {
286286
throw new GenerateMetadataError(`Parameter '${parameterName}:${type.dataType}' can't be passed as form field parameter in '${this.method.toUpperCase()}'.`, parameter);

0 commit comments

Comments
 (0)