Skip to content

Commit

Permalink
fix: generate doc for getters (#1780)
Browse files Browse the repository at this point in the history
  • Loading branch information
akkshitgupta authored Feb 15, 2024
1 parent 819919e commit 8598e34
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/generators/typescript/presets/DescriptionPreset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const TS_DESCRIPTION_PRESET: TypeScriptPreset = {
self({ renderer, model, content }) {
return renderDescription({ renderer, content, item: model });
},
property({ renderer, property, content }) {
getter({ renderer, property, content }) {
return renderDescription({ renderer, content, item: property.property });
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,7 @@ exports[`Description generation should render example function for model 1`] = `
*/
class Test {
private _stringProp: string;
/**
* Description
* @example Example
*/
private _numberProp?: number;
/**
* @example Example 1, Example 2
*/
private _objectProp?: NestedTest;
private _additionalProperties?: Map<string, any>;
Expand All @@ -32,9 +25,16 @@ class Test {
get stringProp(): string { return this._stringProp; }
set stringProp(stringProp: string) { this._stringProp = stringProp; }
/**
* Description
* @example Example
*/
get numberProp(): number | undefined { return this._numberProp; }
set numberProp(numberProp: number | undefined) { this._numberProp = numberProp; }
/**
* @example Example 1, Example 2
*/
get objectProp(): NestedTest | undefined { return this._objectProp; }
set objectProp(objectProp: NestedTest | undefined) { this._objectProp = objectProp; }
Expand Down

0 comments on commit 8598e34

Please sign in to comment.