You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, nice work on json-typedef! Exactly what I need for a project.
I know that by using optionalProperties, the Go type-structs generated will include omitempty in the structure's JSON annotation.
However, there are times in Go when a member of properties would also benefit from the addition of omitempty when Marshaling the structure back into JSON.
A potential solution: Support an additional metadata key/value for the Go language, perhaps goOmitempty, to allow the user to indicate that omitempty is desired in the JSON annotation for a specific JSON key. (Similar to the goType key in metadata.) Feel free to improve on this idea.
Perhaps I've missed an existing solution to this, I'm aware of the items seen in the "References" section, but that's about it. Please let me know if there is an existing solution.
First of all, nice work on json-typedef! Exactly what I need for a project.
I know that by using
optionalProperties
, the Go type-structs generated will includeomitempty
in the structure's JSON annotation.However, there are times in Go when a member of
properties
would also benefit from the addition ofomitempty
when Marshaling the structure back into JSON.A potential solution: Support an additional
metadata
key/value for the Go language, perhapsgoOmitempty
, to allow the user to indicate thatomitempty
is desired in the JSON annotation for a specific JSON key. (Similar to thegoType
key inmetadata
.) Feel free to improve on this idea.Perhaps I've missed an existing solution to this, I'm aware of the items seen in the "References" section, but that's about it. Please let me know if there is an existing solution.
Thank you for your consideration.
References:
The text was updated successfully, but these errors were encountered: