grafana/pkg/schema/testdata/trimapplydefaults/test3
ying-jeanne a7ea0ca849
refactory to move trim/apply default into schema.go (#33754)
* refactory to move trim/apply default into schema.go

* fix comments

* move schema test outside of load folder
2021-05-12 15:38:00 +08:00

46 lines
784 B
Plaintext

Verifies common usecases for trimdefault/applydefault functions:
* Nested struct
* Simple array
-- CUE --
{
annotations?: list: [...{
builtIn: number | *0
datasource: string
enable?: bool | *true
hide?: bool | *false
iconColor?: string
name?: string
type: string | *"dashboard"
rawQuery?: string
showIn: number | *0
}]
}
-- Full --
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"name": "Annotations & Alerts",
"type": "dashboard",
"showIn": 0
}
]
}
}
-- Trimed --
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"name": "Annotations & Alerts"
}
]
}
}