mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Codegen: Add support for optional maps (#60883)
This commit is contained in:
parent
3ceb3edcb9
commit
7fd1d5cef0
@ -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.
|
||||
|
@ -18,7 +18,7 @@ export interface Team {
|
||||
/**
|
||||
* AccessControl metadata associated with a given resource.
|
||||
*/
|
||||
accessControl: Record<string, unknown>;
|
||||
accessControl?: Record<string, unknown>;
|
||||
/**
|
||||
* AvatarUrl is the team's avatar URL.
|
||||
*/
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -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"`
|
||||
|
Loading…
Reference in New Issue
Block a user