diff --git a/libraries/api-documenter/src/DocItemSet.ts b/libraries/api-documenter/src/DocItemSet.ts index 69b5f1ff04c..2b5a0db5943 100644 --- a/libraries/api-documenter/src/DocItemSet.ts +++ b/libraries/api-documenter/src/DocItemSet.ts @@ -82,6 +82,7 @@ export class DocItem { break; case 'constructor': this.kind = DocItemKind.Constructor; + this.name = 'constructor'; break; case 'function': this.kind = DocItemKind.Function; diff --git a/libraries/api-documenter/src/yaml/YamlGenerator.ts b/libraries/api-documenter/src/yaml/YamlGenerator.ts index 0e064f38e51..a550df2155e 100644 --- a/libraries/api-documenter/src/yaml/YamlGenerator.ts +++ b/libraries/api-documenter/src/yaml/YamlGenerator.ts @@ -9,6 +9,7 @@ import { MarkupElement, IDocElement, IApiMethod, + IApiConstructor, IApiParameter, IApiProperty, IApiEnumMember @@ -195,7 +196,7 @@ export class YamlGenerator { } yamlItem.name = docItem.name; - yamlItem.fullName = docItem.name; + yamlItem.fullName = yamlItem.uid; yamlItem.langs = [ 'typeScript' ]; switch (docItem.kind) { @@ -228,6 +229,7 @@ export class YamlGenerator { break; case DocItemKind.Constructor: yamlItem.type = 'constructor'; + this._populateYamlMethod(yamlItem, docItem); break; case DocItemKind.Property: yamlItem.type = 'property'; @@ -248,7 +250,7 @@ export class YamlGenerator { } private _populateYamlMethod(yamlItem: Partial, docItem: DocItem): void { - const apiMethod: IApiMethod = docItem.apiItem as IApiMethod; + const apiMethod: IApiMethod | IApiConstructor = docItem.apiItem as IApiMethod; yamlItem.name = RenderingHelpers.getConciseSignature(docItem.name, apiMethod); const syntax: IYamlSyntax = {