-
-
Notifications
You must be signed in to change notification settings - Fork 12
Incorrect field descriptions due to type property usage in schema parser #76
Copy link
Copy link
Labels
Description
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
stringorDate. - 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.
Reactions are currently unavailable