Skip to content

Commit c35cfb2

Browse files
authored
Nilablity Update w/ Rules (#10)
1 parent 53ac1b9 commit c35cfb2

45 files changed

Lines changed: 79 additions & 79 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# openrtb [![Go Reference](https://pkg.go.dev/badge/github.com/prebid/openrtb/v19.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v19) [![Test](https://github.com/prebid/openrtb/actions/workflows/test.yml/badge.svg)](https://github.com/prebid/openrtb/actions/workflows/test.yml)
1+
# openrtb [![Go Reference](https://pkg.go.dev/badge/github.com/prebid/openrtb/v20.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v20) [![Test](https://github.com/prebid/openrtb/actions/workflows/test.yml/badge.svg)](https://github.com/prebid/openrtb/actions/workflows/test.yml)
22

33
[OpenRTB](https://iabtechlab.com/standards/openrtb/), [AdCOM](https://iabtechlab.com/standards/openmedia) and [OpenRTB Dynamic Native Ads](https://iabtechlab.com/standards/openrtb-native/) types for [Go programming language](https://golang.org/)
44

@@ -9,24 +9,24 @@
99

1010
**Requires Go 1.16+**
1111

12-
This library uses [Go modules](https://golang.org/ref/mod) ([tl;dr](https://blog.golang.org/using-go-modules)) and requires Go [1.16](https://golang.org/doc/go1.16)+ to enable the ability to issue release retractions.
12+
This library uses [Go modules](https://golang.org/ref/mod) ([tl;dr](https://blog.golang.org/using-go-modules)) and requires Go [1.16](https://golang.org/doc/go1.16)+ for the ability to issue release retractions.
1313

1414
# Using
1515

1616
```bash
17-
go get -u "github.com/prebid/openrtb/v19/..."
17+
go get -u "github.com/prebid/openrtb/v20/..."
1818
```
1919

2020
```go
2121
import (
22-
openrtb2 "github.com/prebid/openrtb/v19/openrtb2"
22+
openrtb2 "github.com/prebid/openrtb/v20/openrtb2"
2323

24-
openrtb3 "github.com/prebid/openrtb/v19/openrtb3"
25-
adcom1 "github.com/prebid/openrtb/v19/adcom1"
24+
openrtb3 "github.com/prebid/openrtb/v20/openrtb3"
25+
adcom1 "github.com/prebid/openrtb/v20/adcom1"
2626

27-
native1 "github.com/prebid/openrtb/v19/native1"
28-
nreq "github.com/prebid/openrtb/v19/native1/request"
29-
nres "github.com/prebid/openrtb/v19/native1/response"
27+
native1 "github.com/prebid/openrtb/v20/native1"
28+
nreq "github.com/prebid/openrtb/v20/native1/request"
29+
nres "github.com/prebid/openrtb/v20/native1/response"
3030
)
3131
```
3232

@@ -51,19 +51,19 @@ The `main` branch always contains latest code, so better use some package manage
5151
- all enums, described in section 5, must be typed with section name singularized (e.g., "5.2 Banner Ad Types" -> `type BannerAdType int8`)
5252
- all typed enums must have constants for each element, prefixed with type name (e.g., "5.2 Banner Ad Types - XHTML Text Ad (usually mobile)" -> `const BannerAdTypeXHTMLTextAd BannerAdType = 1`)
5353
- never use `iota` for enum constants
54-
- OpenRTB (2.x) section "5.1 Content Categories" should remain untyped and have no constants
54+
- OpenRTB (2.x) "content categories" should remain untyped and have no constants
5555

5656
## Pointers/omitempty
5757
Pointer | Omitempty | When to use | Example
5858
------- | --------- | -------------------------------------------------------------------- | ---------------------------------
59-
no | no | _required_ in spec | `Audio.mimes`
60-
yes | yes | _required_ in spec, but is a part of mutually-exclusive group | `Imp.{banner,video,audio,native}`
61-
no | yes | zero value (`""`, `0`) is useless / has no meaning | `Device.ua`
62-
yes | yes | zero value (`""`, `0`) or value absence (`null`) has special meaning | `Device.{dnt,lmt}`
59+
no | no | _required_ in spec | `Audio.MIMEs`
60+
yes | yes | _required_ in spec, but is a part of mutually-exclusive group | `Imp.{Banner,Video,Audio,Native}`
61+
no | yes | zero value (`""`, `0`) has no meaning, is defined in the spec as the default value, or represents time / duration | `Device.UA`
62+
yes | yes | zero value (`""`, `0`) or value absence (`null`) has special meaning | `Device.{DNT,Lmt}`
6363

6464
Using both pointer and `omitempty` is mostly just to save traffic / generate more "canonical" (strict) JSON.
6565

66-
## Documentation ([pkg.go.dev](https://pkg.go.dev/github.com/prebid/openrtb/v19))
66+
## Documentation ([pkg.go.dev](https://pkg.go.dev/github.com/prebid/openrtb/v20))
6767
- [Godoc: documenting Go code](http://blog.golang.org/godoc-documenting-go-code)
6868
- Each entity (type, struct key or constant) should be documented
6969
- Ideally, copy-paste descriptions as-is, but feel free to omit section numbers, so just `<GoTypeName> defines <copy-pasted description from spec>`

adcom1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# adcom1 [![GoDoc](https://godoc.org/github.com/prebid/openrtb/adcom1?status.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v19/adcom1)
1+
# adcom1 [![GoDoc](https://godoc.org/github.com/prebid/openrtb/adcom1?status.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v20/adcom1)
22

33
[AdCOM](https://iabtechlab.com/standards/openmedia/) [1.0](https://github.com/InteractiveAdvertisingBureau/AdCOM) types for [Go programming language](https://golang.org/)

adcom1/adcom1_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
. "github.com/onsi/ginkgo/extensions/table"
99
. "github.com/onsi/gomega"
1010

11-
. "github.com/prebid/openrtb/v19/adcom1"
11+
. "github.com/prebid/openrtb/v20/adcom1"
1212
)
1313

1414
var _ = DescribeTable(

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/prebid/openrtb/v19
1+
module github.com/prebid/openrtb/v20
22

33
go 1.16
44

native1/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# native1 [![GoDoc](https://godoc.org/github.com/prebid/openrtb/native1?status.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v19/native1)
1+
# native1 [![GoDoc](https://godoc.org/github.com/prebid/openrtb/native1?status.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v20/native1)
22

33
[OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) section "7 Reference Lists/Enumerations" types for [Go programming language](https://golang.org/)
44

native1/request/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# native1/request [![GoDoc](https://godoc.org/github.com/prebid/openrtb/native1/request?status.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v19/native1/request)
1+
# native1/request [![GoDoc](https://godoc.org/github.com/prebid/openrtb/native1/request?status.svg)](https://pkg.go.dev/github.com/prebid/openrtb/v20/native1/request)
22

33
[OpenRTB Dynamic Native Ads API](https://iabtechlab.com/standards/openrtb-native/) [1.2](https://iabtechlab.com/wp-content/uploads/2016/07/OpenRTB-Native-Ads-Specification-Final-1.2.pdf) section "4 Native Ad Request Markup Details" types for [Go programming language](https://golang.org/)

native1/request/data.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package request
33
import (
44
"encoding/json"
55

6-
"github.com/prebid/openrtb/v19/native1"
6+
"github.com/prebid/openrtb/v20/native1"
77
)
88

99
// 4.6 Data Object

native1/request/event_tracker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package request
33
import (
44
"encoding/json"
55

6-
"github.com/prebid/openrtb/v19/native1"
6+
"github.com/prebid/openrtb/v20/native1"
77
)
88

99
// 4.7 Event Trackers Request Object

native1/request/image.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package request
33
import (
44
"encoding/json"
55

6-
"github.com/prebid/openrtb/v19/native1"
6+
"github.com/prebid/openrtb/v20/native1"
77
)
88

99
// 4.4 Image Object

native1/request/request.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ package request
88
import (
99
"encoding/json"
1010

11-
"github.com/prebid/openrtb/v19/native1"
11+
"github.com/prebid/openrtb/v20/native1"
1212
)
1313

1414
// 4.1 Native Markup Request Object

0 commit comments

Comments
 (0)