mirror of
https://github.com/grafana/grafana.git
synced 2025-01-16 11:42:35 -06:00
a7ea0ca849
* refactory to move trim/apply default into schema.go * fix comments * move schema test outside of load folder
46 lines
784 B
Plaintext
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"
|
|
}
|
|
]
|
|
}
|
|
} |