Closed Fish-Nullify closed 1 year ago
Hi @Fish-Nullify, Since this field is optional on the mentioned payloads, would it make sense to treat the installation struct accordingly? Something like:
Installation *struct {
ID int64 `json:"id"`
} `json:"installation,omitempty"`
@deankarn do you have an opinion on that?
Hi @robinlieb,
Thanks for the suggestion and I have provided an update to the installation structs for the specified payloads. I can easily revert this if necessary.
@robinlieb I agree, if it’s optional then let’s make it a pointer.
@Fish-Nullify omitempty only works for Serialization in Go and not Deserialization.
@Fish-Nullify could you them please make the installation struct a pointer and remove the omitempty? Like:
Installation *struct {
ID int64 `json:"id"`
} `json:"installation"`
@robinlieb sorry for the late reply was away, but made the installation struct a pointer and removed the omitempty
This pull request fixes issue https://github.com/go-playground/webhooks/issues/177