Skip to content

Conversation

dlarocque
Copy link
Contributor

This fixes an issue with the documentation on DevSite, where enum values' JSDoc strings aren't extracted by our API documenter tool. For example, the ImagenPersonFilterLevel docs don't contain docs for each enum value, despite those explanations being in the source code here.

I removed all documentation from the type union declarations (type x = (typeof x..), because 1) they're not used by API documenter so they aren't in devsite, 2) VSCode type hints inherit the docs of the type union from the object:
image
(here we're hovering the definition of a HarmCategory type union, and we see the docs for the HarmCategory object)

@dlarocque dlarocque requested review from a team as code owners September 23, 2025 16:49
Copy link

changeset-bot bot commented Sep 23, 2025

⚠️ No Changeset found

Latest commit: 72961ec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 23, 2025

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Sep 23, 2025

Copy link
Contributor

@hsubox76 hsubox76 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm misunderstanding, removing the comments above the type unions actually does remove strings from devsite. There's two sections in devsite docs, Variables and Type Aliases, and the consts go under Variables and the string unions go under Type Aliases. That's not great but not really changeable without messing with api-documenter. They both have the same anchor name so if you click on one in the table of contents, you'll only go to the first one (under Variables), but the other one also exists and people could run into it by scrolling, or the short description in the table of contents.

@dlarocque dlarocque requested a review from hsubox76 October 6, 2025 18:00
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.

3 participants