feat(output-options): add prefer-skip-optional-pointer to default to skipping optional pointers#1694
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.
Where does this get triggered? I can't seem to work out where this may occur 🤔
There was a problem hiding this comment.
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
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.