-
-
Notifications
You must be signed in to change notification settings - Fork 954
feat(output-options): add prefer-skip-optional-pointer
to default to skipping optional pointers
#1694
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
Conversation
Thanks for this - will try and look at it once the backlog of items for v2.4.0 are down! |
FYI this would also link in nicely with #1561 (as two alternative ways) |
Kind of from the side, but I personally would like something similar to this. More specifically, I would LOVE to have a "pointers-for-values-with-defaults" such that I can set it to "false" (or something like that). Scattering the |
725345b
to
fa61408
Compare
Just curious if any progress has been made on getting this merged? Would love to use it |
prefer-skip-optional-pointer
to imply skipping optional pointers
pkg/codegen/schema.go
Outdated
// For object references pointers are the only way to denote optional, in contrast | ||
// to other types where the zero-value can be used for that. |
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.
Where does this get triggered? I can't seem to work out where this may occur 🤔
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.
Hmm, I actually don't remember anymore. If I spot anything later, I'll add it here (or in a discussion, or issue or whatever would be appropriate then 😄 )
Related: #1860 |
prefer-skip-optional-pointer
to imply skipping optional pointersprefer-skip-optional-pointer
to default to skipping optional pointers
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.
Thanks a lot for this 💜
I had a similar requirement as in issue #1454 and discussion #1460 a while a go and implemented the following solution.
This is likely not of the necessary quality for merging, but I would still like to open this PR as a discussion about the implementation. If I missed anything obvious that could cause problems down the line, I will certainly adjust as necessary.