-
-
Notifications
You must be signed in to change notification settings - Fork 186
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
feat: fixed data tags, description preset for Go, add goIncludeComments and goIncludeTags flags #2123
base: next
Are you sure you want to change the base?
Conversation
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.
Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
✅ Deploy Preview for modelina canceled.
|
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.
Remember to add the new feature to the Go documentation https://github.com/TertiumOrganum1/modelina/blob/next/docs/languages/Go.md you can just use this as guideline: https://github.com/TertiumOrganum1/modelina/blob/next/docs/languages/TypeScript.md#rendering-comments-from-description-and-example-fields
We also need a single test ensuring that the preset works as expected, just take the one from TypeScript and change it to use Go 🙂 https://github.com/TertiumOrganum1/modelina/blob/next/test/generators/typescript/preset/DescriptionPreset.spec.ts
`${this.model.name} represents a ${this.model.name} model.` | ||
); | ||
|
||
const doc = ''; |
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.
You can remove it completely if it's no longer in use 🙂
…est for go description, removed previously added -i flag, removed unused code and fixed formatting, added modelina_cli/test/fixtures/generate to linter exclusions
Sorry, I don't understand what it wants from me. What does it mean by duplication? Take a look at go examples - they have the same index.spec.ts! But my test is 'duplicated'? |
Quality Gate failedFailed conditions |
/rtm |
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.
Looks like you might be missing to export the preset ✌️
|
Description
Anyway, I've managed to fix the Golang generator: I added comments from descriptions, enabled them in the Go helper, fixed the data tags by adding "required", added a flag to include comments in Go, and included the description preset in modelina-cli. I'm not sure why, but modelina-cli refused to accept the file parameter from the command line (even after packing it into a tarball), so I had to add an optional -i flag to specify the input path.
Related Issue
[FEATURE] Golang generator should include comments from parameter descriptions #2116
Checklist
npm run lint
): yes, but two prettier issues are in conflict with default vscode ts formatter, so I left as is.npm run test
): not yetAdditional Notes
I haven't been able to build the CLI correctly yet: it can't use the modelina library directly from the source (or via npm link). Therefore, I had to run npm run build:prod for modelina, copy its lib folder to the modelina-cli node_modules directory (after the initial npm install), and only then was I able to build modelina-cli and run it. Any advice on how to do this correctly would be appreciated. For now, I'll create a PR just for you to take a look.