diff options
| author | k8s-merge-robot <k8s.production.user@gmail.com> | 2015-11-30 15:49:53 -0800 |
|---|---|---|
| committer | k8s-merge-robot <k8s.production.user@gmail.com> | 2015-11-30 15:49:53 -0800 |
| commit | 415901cde246d441b3d4b30935c9dadf9585a86a (patch) | |
| tree | 6571f28d0c9703dd9a99d9885106e9d1d0b8a6bb | |
| parent | bc465c1d0f7b0f1c7d405cf1c287f255172ce151 (diff) | |
| parent | e1ded93ff37ab654682ff38c0e77e47c6a7681e6 (diff) | |
Merge pull request #17703 from timstclair/api-conventions
Auto commit by PR queue bot
| -rw-r--r-- | api-conventions.md | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/api-conventions.md b/api-conventions.md index 6628e998..43550903 100644 --- a/api-conventions.md +++ b/api-conventions.md @@ -387,7 +387,8 @@ Fields must be either optional or required. Optional fields have the following properties: - They have `omitempty` struct tag in Go. -- They are a pointer type in the Go definition (e.g. `bool *awesomeFlag`). +- They are a pointer type in the Go definition (e.g. `bool *awesomeFlag`) or have a built-in `nil` + value (e.g. maps and slices). - The API server should allow POSTing and PUTing a resource with this field unset. Required fields have the opposite properties, namely: @@ -409,7 +410,8 @@ codebase. However: - having a pointer consistently imply optional is clearer for users of the Go language client, and any other clients that use corresponding types -Therefore, we ask that pointers always be used with optional fields. +Therefore, we ask that pointers always be used with optional fields that do not have a built-in +`nil` value. ## Defaulting |
