Skip to content

Commit

Permalink
Request Wrapper: Only Create Elements If Needed (prebid#2327)
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxNode authored and jorgeluisrocha committed Sep 22, 2022
1 parent 78741d9 commit 968974e
Show file tree
Hide file tree
Showing 5 changed files with 636 additions and 109 deletions.
2 changes: 1 addition & 1 deletion endpoints/openrtb2/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ func (deps *endpointDeps) validateSite(req *openrtb_ext.RequestWrapper) error {
return err
}
siteAmp := siteExt.GetAmp()
if siteAmp < 0 || siteAmp > 1 {
if siteAmp != nil && (*siteAmp < 0 || *siteAmp > 1) {
return errors.New(`request.site.ext.amp must be either 1, 0, or undefined`)
}

Expand Down
7 changes: 2 additions & 5 deletions openrtb_ext/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ type ExtApp struct {
}

// ExtAppPrebid further defines the contract for bidrequest.app.ext.prebid.
// We are only enforcing that these two properties be strings if they are provided.
// They are optional with no current constraints on value, so we don't need a custom
// UnmarshalJSON() method at this time.
type ExtAppPrebid struct {
Source string `json:"source"`
Version string `json:"version"`
Source string `json:"source,omitempty"`
Version string `json:"version,omitempty"`
}
Loading

0 comments on commit 968974e

Please sign in to comment.