Skip to content

Commit

Permalink
remove min and max duration validation
Browse files Browse the repository at this point in the history
  • Loading branch information
sho ishihara committed Nov 1, 2019
1 parent da7bfdf commit ebea466
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
12 changes: 3 additions & 9 deletions video.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ import (

// Validation errors
var (
ErrInvalidVideoNoMIMEs = errors.New("openrtb: video has no mimes")
ErrInvalidVideoNoLinearity = errors.New("openrtb: video linearity missing")
ErrInvalidVideoNoMinDuration = errors.New("openrtb: video min-duration missing")
ErrInvalidVideoNoMaxDuration = errors.New("openrtb: video max-duration missing")
ErrInvalidVideoNoProtocols = errors.New("openrtb: video protocols missing")
ErrInvalidVideoNoMIMEs = errors.New("openrtb: video has no mimes")
ErrInvalidVideoNoLinearity = errors.New("openrtb: video linearity missing")
ErrInvalidVideoNoProtocols = errors.New("openrtb: video protocols missing")
)

// Video object must be included directly in the impression object if the impression offered
Expand Down Expand Up @@ -53,10 +51,6 @@ func (v *Video) Validate() error {
return ErrInvalidVideoNoMIMEs
} else if v.Linearity == 0 {
return ErrInvalidVideoNoLinearity
} else if v.MinDuration == 0 {
return ErrInvalidVideoNoMinDuration
} else if v.MaxDuration == 0 {
return ErrInvalidVideoNoMaxDuration
} else if v.Protocol == 0 && len(v.Protocols) == 0 {
return ErrInvalidVideoNoProtocols
}
Expand Down
9 changes: 0 additions & 9 deletions video_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@ var _ = Describe("Video", func() {
Expect((&Video{
MIMEs: []string{"video/mp4"},
}).Validate()).To(Equal(ErrInvalidVideoNoLinearity))
Expect((&Video{
Linearity: VideoLinearityNonLinear,
MIMEs: []string{"video/mp4"},
}).Validate()).To(Equal(ErrInvalidVideoNoMinDuration))
Expect((&Video{
MinDuration: 1,
Linearity: VideoLinearityNonLinear,
MIMEs: []string{"video/mp4"},
}).Validate()).To(Equal(ErrInvalidVideoNoMaxDuration))
Expect((&Video{
MinDuration: 1,
MaxDuration: 1,
Expand Down

0 comments on commit ebea466

Please sign in to comment.