Skip to content

fix(builder): use property symbol instead of type property#77

Merged
schettn merged 1 commit intomainfrom
fix/type-fields-documentation
Mar 12, 2025
Merged

fix(builder): use property symbol instead of type property#77
schettn merged 1 commit intomainfrom
fix/type-fields-documentation

Conversation

@schettn
Copy link
Copy Markdown
Contributor

@schettn schettn commented Mar 11, 2025

Fix an issue where field descriptions in schema parsing did not work.

Previously, field descriptions (e.g., for interface fields) were not included in the generated schema, as the return type's description was incorrectly used instead of the field's own comments.

Now, field descriptions are correctly parsed from property symbols, ensuring that inline comments are reflected in the generated schema.

Example:

interface Greeting {
  /**
   *  Profile of the user
   */
  profile: string;
  /** Matching status */
  matching: string;
  /** Date of the greeting */
  date: Date;
}

In the above example, the profile, matching, and date fields will now include their respective descriptions in the generated schema.

This fixes the the documentation of type fields (e.g. interfaces) in the
schema parser.
Previously, the return type of the property was used to determine the
description of the field. If a type property used the `Date` type,
the description of the `Date` type was used instead of the actual description
of the field.

This commit changes the behavior to use the property symbol instead of the
return type of the property.

closes #76
@schettn schettn self-assigned this Mar 11, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 11, 2025

🦋 Changeset detected

Latest commit: 573ae50

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@getcronit/pylon-builder Patch
@getcronit/pylon-dev Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@schettn schettn linked an issue Mar 11, 2025 that may be closed by this pull request
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Snapshot Release (canary)

The latest changes of this PR are available as canary on npm (based on the declared changesets):

Package Version Info
@getcronit/pylon-builder 2.6.8-canary-20250311173056.573ae5085c663f87cbd7704d3975323a23288851 npm ↗︎ unpkg ↗︎
@getcronit/pylon-dev 1.0.4-canary-20250311173056.573ae5085c663f87cbd7704d3975323a23288851 npm ↗︎ unpkg ↗︎

@schettn
Copy link
Copy Markdown
Contributor Author

schettn commented Mar 11, 2025

@ericzorn93 I fixed the issue. May you test out the @getcronit/pylon-dev@1.0.4-canary-20250311173056.573ae5085c663f87cbd7704d3975323a23288851?

@ericzorn93
Copy link
Copy Markdown

@schettn, this works, thank you for fixing this

@schettn schettn merged commit 1aacbba into main Mar 12, 2025
1 check passed
@schettn schettn deleted the fix/type-fields-documentation branch March 12, 2025 06:32
@github-actions github-actions bot mentioned this pull request Mar 12, 2025
schettn added a commit that referenced this pull request Mar 12, 2025
This fixes the the documentation of type fields (e.g. interfaces) in the
schema parser.
Previously, the return type of the property was used to determine the
description of the field. If a type property used the `Date` type,
the description of the `Date` type was used instead of the actual description
of the field.

This commit changes the behavior to use the property symbol instead of the
return type of the property.

closes #76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect field descriptions due to type property usage in schema parser

2 participants