Skip to content

Conversation

@tijmenb
Copy link
Contributor

@tijmenb tijmenb commented Nov 15, 2025

Description 📖

This allows you to pass a doc string for the attribute:

class VideoSerializer < BaseSerializer
  type :string, optional: true, doc: "URL to the video on YouTube"
  def youtube_url
    video.youtube_url
  end
end

Which translates into a TSDoc-compliant comment:

export default interface Video {
  /**
  * URL to the video on YouTube
  */
  youtubeUrl?: string
}

Background 📜

We're using types_from_serializers to generate the types and docs for parts of our API. This will allow us to document the attributes that we expose.

The Fix 🔨

Add a doc attribute to the types.

Screenshots 📷

Screenshot 2025-11-15 at 11 02 30

Update the contribution guide, as this is what CI does, so we should do that here too.
Run:

https://github.com/ElMassimo/types_from_serializers/actions/runs/19388286453/job/55478259069?pr=29

The URL returns a 404 now, and the source repo is archived: https://github.com/qltysh-archive/test-reporter

I'm assuming that CodeClimate (qltysh) no longer supports this.
@tijmenb tijmenb closed this Dec 8, 2025
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.

1 participant