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

Changed iframe resource field to be a pointer to get empty values omitted. #32

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions vast.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ type Companion struct {
// URL to a static file, such as an image or SWF file
StaticResource *StaticResource `xml:",omitempty"`
// URL source for an IFrame to display the companion element
IFrameResource CDATAString `xml:",omitempty"`
IFrameResource *CDATAString `xml:",omitempty"`
// HTML to display the companion element
HTMLResource *HTMLResource `xml:",omitempty"`
}
Expand Down Expand Up @@ -426,7 +426,7 @@ type Icon struct {
// URL to a static file, such as an image or SWF file
StaticResource *StaticResource `xml:",omitempty"`
// URL source for an IFrame to display the companion element
IFrameResource CDATAString `xml:",omitempty"`
IFrameResource *CDATAString `xml:",omitempty"`
// HTML to display the companion element
HTMLResource *HTMLResource `xml:",omitempty"`
}
Expand Down
2 changes: 2 additions & 0 deletions vast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ func TestInlineLinear(t *testing.T) {
if assert.NotNil(t, comp1.StaticResource) {
assert.Equal(t, "image/jpeg", comp1.StaticResource.CreativeType)
assert.Equal(t, "http://demo.tremormedia.com/proddev/vast/Blistex1.jpg", comp1.StaticResource.URI)
assert.Nil(t, comp1.IFrameResource)
}
if assert.Len(t, comp1.TrackingEvents, 1) {
assert.Equal(t, "creativeView", comp1.TrackingEvents[0].Event)
Expand Down Expand Up @@ -605,6 +606,7 @@ func TestIcons(t *testing.T) {
assert.Equal(t, "image/png", icon1.StaticResource.CreativeType)
assert.Equal(t, "https://s.aolcdn.com/ads/adchoices.png", icon1.StaticResource.URI)
assert.Equal(t, "https://adinfo.aol.com", icon1.IconClickThrough.CDATA)
assert.Nil(t, icon1.IFrameResource)
}
}
}
Expand Down