-
-
Notifications
You must be signed in to change notification settings - Fork 199
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!: add union types support in go #1882
Conversation
✅ Deploy Preview for modelina canceled.
|
Also remember to add an entry into the migration guide for v4 as this is a breaking change for Go ✌️ |
@kennethaasan since you also seem to do some stuff in go atm, want to have a look? |
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.
Few comments ✌️
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.
Think the only thing missing is adding the example to the list of examples and adapting the go docs to reflect you can change the name of some of the Union fields ✌️
|
||
export interface GoOptions extends CommonGeneratorOptions<GoPreset> { | ||
typeMapping: TypeMapping<GoOptions, GoDependencyManager>; | ||
constraints: Constraints<GoOptions>; | ||
unionAnyModelName: string; |
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.
Please add JS doc to each of these options so people got some idea when trying to use it instead of having to look it up ✌️
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.
Will the developer know what unionAnyModelName
means by reading the description you just provided?
const jsonSchemaDraft7 = { | ||
$schema: 'http://json-schema.org/draft-07/schema#', | ||
type: 'object', | ||
additionalProperties: { |
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.
Do you mind changing the example so it outputs multiple Union types and then use the options for naming so we reflect those options you added?
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.
@Souvikns you never adapted the options to include all the unionAnyModelName
and others. Right now users have no idea the options are there.
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.
@Souvikns please read the comments 🙂
|
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.
Awesome @Souvikns 👍
/rtm |
🎉 This PR is included in version 4.0.0-next.26 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Description
This PR adds support for union types in go.
Related Issue
closes #1842
Checklist
npm run lint
).npm run test
).Additional Notes