You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
71 lines
1.3 KiB
71 lines
1.3 KiB
Verifies common usecases for trimdefault/applydefault functions:
|
|
* open structure should be kept when fields not present
|
|
|
|
-- CUE --
|
|
#ListA: {
|
|
datasource: "gdev-postgres"
|
|
hide: number | *0
|
|
includeAll : bool | *true
|
|
label: string | *"Datacenter"
|
|
}
|
|
#ListB: {
|
|
datasource: "gdev-mysql"
|
|
hide: number | *1
|
|
includeAll : bool | *false
|
|
label: string | *"Datacenter"
|
|
}
|
|
#ListC: {
|
|
datasource: !=""
|
|
hide: number | *2
|
|
includeAll : bool | *false
|
|
label: string | *"Awesome"
|
|
}
|
|
{
|
|
templating?: list: [...#ListA | #ListB | #ListC]
|
|
}
|
|
|
|
-- Full --
|
|
{
|
|
"templating": {
|
|
"list": [
|
|
{
|
|
"datasource": "gdev-postgres",
|
|
"hide": 0,
|
|
"includeAll": false,
|
|
"label": "Datacenter"
|
|
},
|
|
{
|
|
"datasource": "gdev-mysql",
|
|
"hide": 0,
|
|
"includeAll": false,
|
|
"label": "Datacenter"
|
|
},
|
|
{
|
|
"datasource": "gdev-random",
|
|
"hide": 2,
|
|
"includeAll": false,
|
|
"label": "Datacenter"
|
|
}
|
|
]
|
|
}
|
|
}
|
|
|
|
-- Trimmed --
|
|
{
|
|
"templating": {
|
|
"list": [
|
|
{
|
|
"datasource": "gdev-postgres",
|
|
"includeAll": false
|
|
},
|
|
{
|
|
"datasource": "gdev-mysql",
|
|
"hide": 0
|
|
},
|
|
{
|
|
"datasource": "gdev-random",
|
|
"label": "Datacenter"
|
|
}
|
|
]
|
|
}
|
|
}
|