Skip to content
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

Prevents Object from being serialized on the Event resource #798

Merged
merged 1 commit into from
Mar 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion event.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ type EventRequest struct {

// EventData is the unmarshalled object as a map.
type EventData struct {
Object map[string]interface{}
// Object is a raw mapping of the API resource contained in the event.
// Although marked with json:"-", it's still populated independently by
// a custom UnmarshalJSON implementation.
Object map[string]interface{} `json:"-"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think that we could add a comment here that explains that despite the json:"-", this property will be populated independently? Maybe something like:

Object is a raw mapping of the API resource contained in the event.

Although marked with json:"-", it's still populated independently by a custom UnmarshalJSON implementation.

PreviousAttributes map[string]interface{} `json:"previous_attributes"`
Raw json.RawMessage `json:"object"`
}
Expand Down