Add +optional tag to all fields with omitempty json tag

This commit is contained in:
mbohlool
2016-10-14 15:37:37 -07:00
parent f85d8f2e66
commit 25afcc5522
43 changed files with 1665 additions and 133 deletions

View File

@@ -26,7 +26,8 @@ import (
// TODO: enable meta-only decoding for protobuf.
type MetadataOnlyObject struct {
unversioned.TypeMeta `json:",inline"`
v1.ObjectMeta `json:"metadata,omitempty"`
// +optional
v1.ObjectMeta `json:"metadata,omitempty"`
}
// MetadataOnlyObjectList allows decoding from JSON data only the typemeta and metadata of
@@ -34,6 +35,7 @@ type MetadataOnlyObject struct {
// TODO: enable meta-only decoding for protobuf.
type MetadataOnlyObjectList struct {
unversioned.TypeMeta `json:",inline"`
// +optional
unversioned.ListMeta `json:"metadata,omitempty"`
Items []MetadataOnlyObject `json:"items"`