Skip to content

Commit e3600e0

Browse files
committed
fix: missing example undefined chec @ method generator
1 parent 9ab875e commit e3600e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/cli/src/metadataGeneration/methodGenerator.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ export class MethodGenerator {
197197

198198
return decorators.map(decorator => {
199199
const [name, description, example, produces] = getDecoratorValues(decorator, this.current.typeChecker);
200-
responseExamplesByName[name] = responseExamplesByName[name] ? [...responseExamplesByName[name], example] : [example];
200+
201+
if (example !== undefined) {
202+
responseExamplesByName[name] = responseExamplesByName[name] ? [...responseExamplesByName[name], example] : [example];
203+
}
204+
201205
return {
202206
description: description || '',
203207
examples: responseExamplesByName[name] || undefined,

0 commit comments

Comments
 (0)