mirror of
https://github.com/prebid/openrtb.git
synced 2026-06-26 19:56:21 +03:00
Dropped json omitempty tag for required fields, dropped Progress (TODO) section from README
This commit is contained in:
+3
-3
@@ -12,7 +12,7 @@ type Bid struct {
|
||||
// string; required
|
||||
// Description:
|
||||
// Bidder generated bid ID to assist with logging/tracking.
|
||||
ID string `json:"id,omitempty"`
|
||||
ID string `json:"id"`
|
||||
|
||||
// Attribute:
|
||||
// impid
|
||||
@@ -20,7 +20,7 @@ type Bid struct {
|
||||
// string; required
|
||||
// Description:
|
||||
// ID of the Imp object in the related bid request.
|
||||
ImpID string `json:"impid,omitempty"`
|
||||
ImpID string `json:"impid"`
|
||||
|
||||
// Attribute:
|
||||
// price
|
||||
@@ -31,7 +31,7 @@ type Bid struct {
|
||||
// for a unit impression only. Note that while the type indicates
|
||||
// float, integer math is highly recommended when handling
|
||||
// currencies (e.g., BigDecimal in Java).
|
||||
Price float64 `json:"price,omitempty"`
|
||||
Price float64 `json:"price"`
|
||||
|
||||
// Attribute:
|
||||
// adid
|
||||
|
||||
@@ -18,7 +18,7 @@ type BidRequest struct {
|
||||
// string; required
|
||||
// Description:
|
||||
// Unique ID of the bid request, provided by the exchange.
|
||||
ID string `json:"id,omitempty"`
|
||||
ID string `json:"id"`
|
||||
|
||||
// Attribute:
|
||||
// imp
|
||||
@@ -27,7 +27,7 @@ type BidRequest struct {
|
||||
// Description:
|
||||
// Array of Imp objects (Section 3.2.2) representing the
|
||||
// impressions offered. At least 1 Imp object is required.
|
||||
Imp []Imp `json:"imp,omitempty"`
|
||||
Imp []Imp `json:"imp"`
|
||||
|
||||
// Attribute:
|
||||
// site
|
||||
|
||||
@@ -19,7 +19,7 @@ type BidResponse struct {
|
||||
// string; required
|
||||
// Description:
|
||||
// ID of the bid request to which this is a response.
|
||||
ID string `json:"id,omitempty"`
|
||||
ID string `json:"id"`
|
||||
|
||||
// Attribute:
|
||||
// seatbid
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ type Imp struct {
|
||||
// Description:
|
||||
// A unique identifier for this impression within the context of the bid request (typically, starts
|
||||
// with 1 and increments.
|
||||
ID string `json:"id,omitempty"`
|
||||
ID string `json:"id"`
|
||||
|
||||
// Attribute:
|
||||
// banner
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ type Native struct {
|
||||
// string; required
|
||||
// Description:
|
||||
// Request payload complying with the Native Ad Specification.
|
||||
Request string `json:"request,omitempty"`
|
||||
Request string `json:"request"`
|
||||
|
||||
// Attribute:
|
||||
// ver
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
// rtb package provides common OpenRTB's Object types,
|
||||
// rtb package provides OpenRTB v2.3 types,
|
||||
// according to OpenRTB API Specification Version 2.3:
|
||||
// http://openrtb.github.io/OpenRTB/
|
||||
package rtb
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ type SeatBid struct {
|
||||
// Description:
|
||||
// Array of 1+ Bid objects (Section 4.2.3) each related to an
|
||||
// impression. Multiple bids can relate to the same impression.
|
||||
Bid []Bid `json:"bid,omitempty"`
|
||||
Bid []Bid `json:"bid"`
|
||||
|
||||
// Attribute:
|
||||
// seat
|
||||
|
||||
@@ -2,41 +2,9 @@
|
||||
|
||||
[](https://godoc.org/github.com/mxmCherry/go-rtb/2.3/rtb)
|
||||
|
||||
Common [OpenRTB](//github.com/openrtb/OpenRTB) [v2.3](//github.com/openrtb/OpenRTB/blob/master/OpenRTB-API-Specification-Version-2-3-FINAL.pdf) Object types for Go programming language
|
||||
|
||||
**Warning!** Currently, this package is quite unstable (types and names may change). Also, even after v1.0 this repo will contain only recent version (v1+). So, if you need to use this code in production, take a look on [godep](//github.com/tools/godep).
|
||||
|
||||
|
||||
# Progress
|
||||
- [x] 3.2 Object Specifications
|
||||
- [x] 3.2.1 Object: BidRequest
|
||||
- [x] 3.2.2 Object: Imp
|
||||
- [x] 3.2.3 Object: Banner
|
||||
- [x] 3.2.4 Object: Video
|
||||
- [x] 3.2.5 Object: Native
|
||||
- [x] 3.2.6 Object: Site
|
||||
- [x] 3.2.7 Object: App
|
||||
- [x] 3.2.8 Object: Publisher
|
||||
- [x] 3.2.9 Object: Content
|
||||
- [x] 3.2.10 Object: Producer
|
||||
- [x] 3.2.11 Object: Device
|
||||
- [x] 3.2.12 Object: Geo
|
||||
- [x] 3.2.13 Object: User
|
||||
- [x] 3.2.14 Object: Data
|
||||
- [x] 3.2.15 Object: Segment
|
||||
- [x] 3.2.16 Object: Regs
|
||||
- [x] 3.2.17 Object: Pmp
|
||||
- [x] 3.2.18 Object: Deal
|
||||
- [x] 4.2 Object Specifications
|
||||
- [x] 4.2.1 Object: BidResponse
|
||||
- [x] 4.2.2 Object: SeatBid
|
||||
- [x] 4.2.3 Object: Bid
|
||||
- [ ] Code quality/review
|
||||
- [x] Review struct key types, which refer to section "5. Enumerated Lists Specification"
|
||||
- [x] Check types for struct keys (see Guidelines - Types)
|
||||
- [x] Use struct pointers for optional keys (e.g., App.Content)
|
||||
- [ ] ~~Add json directive "omitempty" for optional keys~~ Remove json directive "omitempty" for required fields or fields with meaningful golang-empty values (like numeric 0)
|
||||
[OpenRTB](//github.com/openrtb/OpenRTB) [v2.3](//github.com/openrtb/OpenRTB/blob/master/OpenRTB-API-Specification-Version-2-3-FINAL.pdf) types for Go programming language (golang)
|
||||
|
||||
**Warning!** This package is considered unstable, consider using [glide](https://github.com/Masterminds/glide) for vendoring specific version (commit hash).
|
||||
|
||||
# Guidelines
|
||||
|
||||
@@ -46,7 +14,7 @@ Common [OpenRTB](//github.com/openrtb/OpenRTB) [v2.3](//github.com/openrtb/OpenR
|
||||
- Capitalized ID keys
|
||||
|
||||
## Types
|
||||
- Key types should be chosen according to OpenRTB specification (attribute types)
|
||||
- Key types should be chosen according to OpenRTB v2.3 specification (attribute types)
|
||||
- Numeric types:
|
||||
- architecture-independent, e.g., ```int32``` instead of ```int```
|
||||
- signed integral types should be used only when absolutely needed (value may contain negative numbers), unsigned integral types are preferred
|
||||
|
||||
Reference in New Issue
Block a user