From 93eb93465702018026ca2cd85847329ce209d973 Mon Sep 17 00:00:00 2001 From: Vikram Sreekumar Date: Mon, 3 Apr 2017 18:09:42 +0530 Subject: [PATCH] inventory: fixed typo in inventory model. - renamed pivacypolicy to privacypolicy. - updated the test case to reflect this change. --- bidrequest_test.go | 14 ++++++++------ inventory.go | 14 +++++++------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/bidrequest_test.go b/bidrequest_test.go index 9a491cc..4b6c97c 100644 --- a/bidrequest_test.go +++ b/bidrequest_test.go @@ -2,13 +2,14 @@ package openrtb import ( "encoding/json" + . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("BidRequest", func() { var subject *BidRequest - + privacyPolicy := 1 BeforeEach(func() { err := fixture("breq.banner", &subject) Expect(err).NotTo(HaveOccurred()) @@ -35,11 +36,12 @@ var _ = Describe("BidRequest", func() { }, Site: &Site{ Inventory: Inventory{ - ID: "234563", - Name: "Site ABCD", - Domain: "siteabcd.com", - Cat: []string{"IAB2-1", "IAB2-2"}, - Publisher: &Publisher{ID: "pub12345", Name: "Publisher A"}, + ID: "234563", + Name: "Site ABCD", + Domain: "siteabcd.com", + Cat: []string{"IAB2-1", "IAB2-2"}, + Publisher: &Publisher{ID: "pub12345", Name: "Publisher A"}, + PrivacyPolicy: &privacyPolicy, Content: &Content{ Keywords: "keyword a,keyword b,keyword c", }, diff --git a/inventory.go b/inventory.go index 7b15d47..f119287 100644 --- a/inventory.go +++ b/inventory.go @@ -4,13 +4,13 @@ type Inventory struct { ID string `json:"id,omitempty"` // ID on the exchange Name string `json:"name,omitempty"` Domain string `json:"domain,omitempty"` - Cat []string `json:"cat,omitempty"` // Array of IAB content categories - SectionCat []string `json:"sectioncat,omitempty"` // Array of IAB content categories for subsection - PageCat []string `json:"pagecat,omitempty"` // Array of IAB content categories for page - PrivacyPolicy *int `json:"pivacypolicy,omitempty"` // Default: 1 ("1": has a privacy policy) - Publisher *Publisher `json:"publisher,omitempty"` // Details about the Publisher - Content *Content `json:"content,omitempty"` // Details about the Content - Keywords string `json:"keywords,omitempty"` // Comma separated list of keywords about the site. + Cat []string `json:"cat,omitempty"` // Array of IAB content categories + SectionCat []string `json:"sectioncat,omitempty"` // Array of IAB content categories for subsection + PageCat []string `json:"pagecat,omitempty"` // Array of IAB content categories for page + PrivacyPolicy *int `json:"privacypolicy,omitempty"` // Default: 1 ("1": has a privacy policy) + Publisher *Publisher `json:"publisher,omitempty"` // Details about the Publisher + Content *Content `json:"content,omitempty"` // Details about the Content + Keywords string `json:"keywords,omitempty"` // Comma separated list of keywords about the site. Ext Extension `json:"ext,omitempty"` }