-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
fix: generate doc for getters #1780
fix: generate doc for getters #1780
Conversation
✅ Deploy Preview for modelina canceled.
|
Pull Request Test Coverage Report for Build 7913250574Details
💛 - Coveralls |
Hey @Samridhi-98 can you please review this pull request. Thank You 😄 |
@@ -37,7 +37,7 @@ export const TS_DESCRIPTION_PRESET: TypeScriptPreset = { | |||
self({ renderer, model, content }) { | |||
return renderDescription({ renderer, content, item: model }); | |||
}, | |||
property({ renderer, property, content }) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to make it slightly more advanced, and use the options argument to conditionally write docs for properties or getters depending on whether the option for using getters is sat 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could not understand from the given issue description, unfortunately.
Can you confirm whether the option we are referring to is passed from the playground UI just like includeDescription or there is any other way for that.
export interface ModelinaTypeScriptOptions extends ModelinaGeneralOptions {
tsMarshalling: boolean;
tsModelType: 'class' | 'interface' | undefined;
tsEnumType: 'union' | 'enum' | undefined;
tsMapType: 'indexedObject' | 'map' | 'record' | undefined;
tsModuleSystem: 'ESM' | 'CJS' | undefined;
tsIncludeDescriptions: boolean;
tsIncludeJsonBinPack: boolean;
tsIncludeExampleFunction: boolean;
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply @akkshitgupta 🙇
So actually I see that it's quite hard to check whether we are using getters or properties, cause it's determined based on the presets that the user includes.
As a quick workaround, lets add the description both for getter and property (does not matter if there are duplicate information for now ✌️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the late reply @akkshitgupta 🙇
I understand that you are occupied with your work as well. Thank you for being helpful as it encourages me to accept more challenges and continue my journey with AsyncAPI.
does not matter if there are duplicate information for now.
I would like to solve it out rather than just allowing the duplicates if it not much necessary to include description for getters and hold up the PR for now. LMK WDYT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am getting so confused with all these PRs targeting different languages where some use getters and setters automatically and others have options to turn them on and off..
For TypeScript it's always on and can't be turned off... So your implementation is excellent 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking this long to end up with nothing but smoke 🙇
/rtm |
@Samridhi-98 do you have time to take a look ✌️ |
/rtm |
Quality Gate failedFailed conditions |
@all-contributors please add @akkshitgupta for code, bugs |
I've put up a pull request to add @akkshitgupta! 🎉 |
🎉 This PR is included in version 3.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 4.0.0-next.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This pull request corrects the generated code docs to their expected position.
Related Issue
Fixes #1548
Checklist
npm run lint
).npm run test
).