Description
When generating schema documentation, the parser incorrectly uses the return type's description instead of the field's actual description. This leads to misleading documentation, especially for fields with common types like Date.
Current Behavior
Given the following interface:
interface Greeting {
/**
* Profile
*/
profile: string;
/** Matching */
matching: string;
/** Date */
date: Date;
}
The date field inherits the description of the Date type rather than using its inline comment (/** Date */).
Expected Behavior
The parser should use the field’s symbol (e.g., date, profile, etc.) to correctly extract the associated comments, ensuring accurate documentation.
Steps to Reproduce
- Define an interface with fields using primitive types like
string or Date.
- Add comments to describe each field.
- Parse the schema and observe the generated documentation.
- Notice how the description of the field inherits the type's documentation instead of using the field’s own comment.
Proposed Fix
- Update the parser logic to use property symbols instead of type properties when determining field descriptions.
Description
When generating schema documentation, the parser incorrectly uses the return type's description instead of the field's actual description. This leads to misleading documentation, especially for fields with common types like
Date.Current Behavior
Given the following interface:
The
datefield inherits the description of theDatetype rather than using its inline comment (/** Date */).Expected Behavior
The parser should use the field’s symbol (e.g.,
date,profile, etc.) to correctly extract the associated comments, ensuring accurate documentation.Steps to Reproduce
stringorDate.Proposed Fix