Skip to content

Commit e4339a8

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

File tree

2 files changed

+1008
-1097
lines changed

2 files changed

+1008
-1097
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)