Skip to content

Commit 56b664a

Browse files
committed
Emit codegen_name for response value bodies
1 parent 1ec9346 commit 56b664a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

compiler/src/model/build-model.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,18 @@ function compileClassOrInterfaceDeclaration (declaration: ClassDeclaration | Int
383383
if (property.valueOf.kind === 'instance_of' && property.valueOf.type.name === 'Void') {
384384
type.body = { kind: 'no_body' }
385385
} else {
386-
type.body = { kind: 'value', value: property.valueOf }
386+
const tags = parseJsDocTags((member as PropertySignature).getJsDocs())
387+
// TODO: Enable this after adding the missing codegen names.
388+
// assert(
389+
// member as Node,
390+
// tags.codegen_name != null,
391+
// 'You should configure a body @codegen_name'
392+
// )
393+
type.body = {
394+
kind: 'value',
395+
value: property.valueOf,
396+
codegenName: tags.codegen_name
397+
}
387398
}
388399
} else {
389400
type.body = { kind: 'properties', properties: property.properties }

0 commit comments

Comments
 (0)