Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #24 from mxmCherry/feature/switch-from-rawjson-to-…
Browse files Browse the repository at this point in the history
…json-rawmessage

Switch from custom RawJSON to json.RawMessage
  • Loading branch information
mxmCherry authored Mar 3, 2018
2 parents c426d33 + fd8bfbb commit c97c050
Show file tree
Hide file tree
Showing 45 changed files with 139 additions and 299 deletions.
4 changes: 3 additions & 1 deletion app.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.14 Object: App
//
// This object should be included if the ad supported content is a non-browser application (typically in mobile) as opposed to a website.
Expand Down Expand Up @@ -130,5 +132,5 @@ type App struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion audio.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.8 Object: Audio
//
// This object represents an audio type impression.
Expand Down Expand Up @@ -178,5 +180,5 @@ type Audio struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion banner.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.6 Object: Banner
//
// This object represents the most general type of impression.
Expand Down Expand Up @@ -165,5 +167,5 @@ type Banner struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion bid.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 4.2.3 Object: Bid
//
// A SeatBid object contains one or more Bid objects, each of which relates to a specific impression in the bid request via the impid attribute and constitutes an offer to buy that impression for a given price.
Expand Down Expand Up @@ -273,5 +275,5 @@ type Bid struct {
// object
// Description:
// Placeholder for bidder-specific extensions to OpenRTB
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion bid_request.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.1 Object: BidRequest
//
// The top-level bid request object contains a globally unique bid request or auction ID.
Expand Down Expand Up @@ -205,5 +207,5 @@ type BidRequest struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion bid_response.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 4.2.1 Object: BidResponse
//
// This object is the top-level bid response object (i.e., the unnamed outer JSON object).
Expand Down Expand Up @@ -70,5 +72,5 @@ type BidResponse struct {
// object
// Description:
// Placeholder for bidder-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion content.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.16 Object: Content
//
// This object describes the content in which the impression will appear, which may be syndicated or nonsyndicated content.
Expand Down Expand Up @@ -226,5 +228,5 @@ type Content struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion data.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.21 Object: Data
//
// The data and segment objects together allow additional data about the related object (e.g., user, content) to be specified.
Expand Down Expand Up @@ -39,5 +41,5 @@ type Data struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion deal.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.12 Object: Deal
//
// This object constitutes a specific deal that was struck a priori between a buyer and a seller.
Expand Down Expand Up @@ -70,5 +72,5 @@ type Deal struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion device.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.18 Object: Device
//
// This object provides information pertaining to the device through which the user is interacting.
Expand Down Expand Up @@ -271,5 +273,5 @@ type Device struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion format.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.10 Object: Format
//
// This object represents an allowed size (i.e., height and width combination) or Flex Ad parameters for a banner impression.
Expand Down Expand Up @@ -54,5 +56,5 @@ type Format struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion geo.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.19 Object: Geo
//
// This object encapsulates various methods for specifying a geographic location.
Expand Down Expand Up @@ -133,5 +135,5 @@ type Geo struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion imp.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.4 Object: Imp
//
// This object describes an ad placement or impression being auctioned.
Expand Down Expand Up @@ -176,5 +178,5 @@ type Imp struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion metric.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.5 Object: Metric
//
// This object is associated with an impression as an array of metrics.
Expand Down Expand Up @@ -42,5 +44,5 @@ type Metric struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion native.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package openrtb

import "encoding/json"

// 3.2.9 Object: Native
//
// This object represents a native type impression.
Expand Down Expand Up @@ -57,5 +59,5 @@ type Native struct {
// object
// Description:
// Placeholder for exchange-specific extensions to OpenRTB.
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
4 changes: 3 additions & 1 deletion native/request/asset.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package request

import "encoding/json"

// 4.2 Asset Object
//
// The main container object for each asset requested or supported by Exchange on behalf of the rendering client.
Expand Down Expand Up @@ -99,5 +101,5 @@ type Asset struct {
// object
// Description:
// This object is a placeholder that may contain custom JSON agreed to by the parties to support flexibility beyond the standard defined in this specification
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
8 changes: 6 additions & 2 deletions native/request/data.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package request

import "github.com/mxmCherry/openrtb/native"
import (
"encoding/json"

"github.com/mxmCherry/openrtb/native"
)

// 4.6 Data Object
//
Expand Down Expand Up @@ -39,5 +43,5 @@ type Data struct {
// object
// Description:
// This object is a placeholder that may contain custom JSON agreed to by the parties to support flexibility beyond the standard defined in this specification
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
8 changes: 6 additions & 2 deletions native/request/event_tracker.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package request

import "github.com/mxmCherry/openrtb/native"
import (
"encoding/json"

"github.com/mxmCherry/openrtb/native"
)

// 4.7 Event Trackers Request Object
//
Expand Down Expand Up @@ -37,5 +41,5 @@ type EventTracker struct {
// object
// Description:
// This object is a placeholder that may contain custom JSON agreed to by the parties to support flexibility beyond the standard defined in this specification
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
8 changes: 6 additions & 2 deletions native/request/image.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package request

import "github.com/mxmCherry/openrtb/native"
import (
"encoding/json"

"github.com/mxmCherry/openrtb/native"
)

// 4.4 Image Object
//
Expand Down Expand Up @@ -90,5 +94,5 @@ type Image struct {
// object
// Description:
// This object is a placeholder that may contain custom JSON agreed to by the parties to support flexibility beyond the standard defined in this specification
Ext RawJSON `json:"ext,omitempty"`
Ext json.RawMessage `json:"ext,omitempty"`
}
27 changes: 0 additions & 27 deletions native/request/raw_json.go

This file was deleted.

57 changes: 0 additions & 57 deletions native/request/raw_json_test.go

This file was deleted.

Loading

0 comments on commit c97c050

Please sign in to comment.