Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript include documentation for properties instead of getters #1548

Closed
jonaslagoni opened this issue Oct 4, 2023 · 9 comments · Fixed by #1780
Closed

TypeScript include documentation for properties instead of getters #1548

jonaslagoni opened this issue Oct 4, 2023 · 9 comments · Fixed by #1780
Labels
enhancement New feature or request good first issue Good for newcomers released on @next released TS generator Anything related to the TypeScript generator

Comments

@jonaslagoni
Copy link
Member

Reason/Context

Setting the description on private properties does not show up on auto completion. See this: https://modelina.org/playground?tsIncludeDescriptions=true

Description

Instead the code should be:


class LightMeasured {
  private _id?: number;
  private _lumens?: number;
  private _sentAt?: string;
  private _additionalProperties?: Map<string, any>;

  constructor(input: {
    id?: number,
    lumens?: number,
    sentAt?: string,
    additionalProperties?: Map<string, any>,
  }) {
    this._id = input.id;
    this._lumens = input.lumens;
    this._sentAt = input.sentAt;
    this._additionalProperties = input.additionalProperties;
  }

  /**
   * Id of the streetlight.
   */
  get id(): number | undefined { return this._id; }
  set id(id: number | undefined) { this._id = id; }

  /**
   * Light intensity measured in lumens.
   */
  get lumens(): number | undefined { return this._lumens; }
  set lumens(lumens: number | undefined) { this._lumens = lumens; }

  /**
   * Date and time when the message was sent.
   */
  get sentAt(): string | undefined { return this._sentAt; }
  set sentAt(sentAt: string | undefined) { this._sentAt = sentAt; }

  get additionalProperties(): Map<string, any> | undefined { return this._additionalProperties; }
  set additionalProperties(additionalProperties: Map<string, any> | undefined) { this._additionalProperties = additionalProperties; }
}
module.exports = LightMeasured;
@jonaslagoni jonaslagoni added the enhancement New feature or request label Oct 4, 2023
@jonaslagoni jonaslagoni changed the title TypeScript description preset include documentation for properties instead of getters TypeScript include documentation for properties instead of getters Oct 4, 2023
@Samridhi-98
Copy link
Collaborator

Hi @jonaslagoni , I would like to take this one 🙂

@jonaslagoni
Copy link
Member Author

jonaslagoni commented Oct 27, 2023

@Samridhi-98 how is it going 🙂? Let me know if you need anything 👍

@Samridhi-98
Copy link
Collaborator

@Samridhi-98 how is it going 🙂? Let me know if you need anything 👍

I have started working on it soon will come up with PR if need any help will let you know, Thanks :)

@jonaslagoni
Copy link
Member Author

@Samridhi-98 any update? 🙂

@jonaslagoni jonaslagoni added good first issue Good for newcomers TS generator Anything related to the TypeScript generator labels Dec 14, 2023
@AayushSaini101
Copy link

@jonaslagoni I am on it

@bhanudatsinhjhala
Copy link

is this issue still pending @jonaslagoni ?
If yess, then I'm happy to jump on this.

@jonaslagoni
Copy link
Member Author

It is, go ahead @bhanudatsinhjhala 💪

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 3.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@asyncapi-bot
Copy link
Contributor

🎉 This issue has been resolved in version 4.0.0-next.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers released on @next released TS generator Anything related to the TypeScript generator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants