Skip to content

Incorrect field descriptions due to type property usage in schema parser #76

@schettn

Description

@schettn

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

  1. Define an interface with fields using primitive types like string or Date.
  2. Add comments to describe each field.
  3. Parse the schema and observe the generated documentation.
  4. 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.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions