diff --git a/kinds/structured/team/team_kind.cue b/kinds/structured/team/team_kind.cue index 6b1d9da1f2e..b5469db4e56 100644 --- a/kinds/structured/team/team_kind.cue +++ b/kinds/structured/team/team_kind.cue @@ -21,7 +21,7 @@ lineage: seqs: [ // TODO - it seems it's a team_member.permission, unlikely it should belong to the team kind permission: #Permission @grafanamaturity(ToMetadata="kind", MaybeRemove) // AccessControl metadata associated with a given resource. - accessControl: [string]: bool @grafanamaturity(ToMetadata="sys") + accessControl?: [string]: bool @grafanamaturity(ToMetadata="sys") // Created indicates when the team was created. created: int64 @grafanamaturity(ToMetadata="sys") // Updated indicates when the team was updated. diff --git a/packages/grafana-schema/src/raw/team/x/team_types.gen.ts b/packages/grafana-schema/src/raw/team/x/team_types.gen.ts index f76ca40bbd2..24bc4e83f6d 100644 --- a/packages/grafana-schema/src/raw/team/x/team_types.gen.ts +++ b/packages/grafana-schema/src/raw/team/x/team_types.gen.ts @@ -18,7 +18,7 @@ export interface Team { /** * AccessControl metadata associated with a given resource. */ - accessControl: Record; + accessControl?: Record; /** * AvatarUrl is the team's avatar URL. */ diff --git a/pkg/codegen/util_go.go b/pkg/codegen/util_go.go index fef81091403..cdd464e2914 100644 --- a/pkg/codegen/util_go.go +++ b/pkg/codegen/util_go.go @@ -220,7 +220,7 @@ func DecoderCompactor() dstutil.ApplyFunc { c.Delete() } case *dst.Field: - if id, is := x.Type.(*dst.Ident); is { + if id, is := ddepoint(x.Type).(*dst.Ident); is { if expr, has := replace[id.Name]; has { x.Type = expr } diff --git a/pkg/kinds/team/team_types_gen.go b/pkg/kinds/team/team_types_gen.go index 223a4a91247..c38820d7667 100644 --- a/pkg/kinds/team/team_types_gen.go +++ b/pkg/kinds/team/team_types_gen.go @@ -25,7 +25,7 @@ type Permission int // Team defines model for team. type Team struct { // AccessControl metadata associated with a given resource. - AccessControl map[string]bool `json:"accessControl"` + AccessControl map[string]bool `json:"accessControl,omitempty"` // AvatarUrl is the team's avatar URL. AvatarUrl *string `json:"avatarUrl,omitempty"`