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
This commit is contained in:
+46
@@ -0,0 +1,46 @@
|
||||
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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user