summaryrefslogtreecommitdiff
path: root/lib/configuration/tests/configuration.t
diff options
context:
space:
mode:
authorSébastien Dailly <sebastien@dailly.me>2026-11-19 11:32:16 +0100
committerSébastien Dailly <sebastien@dailly.me>2026-11-19 11:32:16 +0100
commit8708171877054c98aad45079d85d4e699420f2fe (patch)
tree2e580e6891708b7b70d07f7bec03bd0a76ae171b /lib/configuration/tests/configuration.t
parente1bf7686f408b52a870d4ed4f3c565dbbcc3954f (diff)
Added fields in lists
Diffstat (limited to 'lib/configuration/tests/configuration.t')
-rw-r--r--lib/configuration/tests/configuration.t55
1 files changed, 48 insertions, 7 deletions
diff --git a/lib/configuration/tests/configuration.t b/lib/configuration/tests/configuration.t
index 880e690..5d14bbb 100644
--- a/lib/configuration/tests/configuration.t
+++ b/lib/configuration/tests/configuration.t
@@ -76,20 +76,17 @@ Cycles between elements are accepted when they are not mandatory to each other
-Lists are declared in the "list" key, with a source given either as a plain
-kind string or as an object with a "type" and an optional "file". A reference
-field can target a list, like a content:
+Lists are declared in the "list" key. A reference field can target a list,
+like a content:
$ tests --configuration <<EOF
> {
> "list": [
> {
- > "id": "user_type_list",
- > "source": "csv"
+ > "id": "user_type_list"
> },
> {
- > "id": "status_list",
- > "source": { "type": "csv", "file": "status.csv" }
+ > "id": "status_list"
> }
> ],
> "content": [
@@ -119,3 +116,47 @@ field can target a list, like a content:
> }
> EOF
+
+Lists can declare their own fields, directly under the "field" key (there is
+no section in a list). A reference field in a list can target another list:
+
+ $ tests --configuration <<EOF
+ > {
+ > "list": [
+ > {
+ > "id": "country_list",
+ > "field": [
+ > { "name": "name", "label": {}, "type": "text" },
+ > { "name": "code", "label": {}, "type": "text" }
+ > ]
+ > },
+ > {
+ > "id": "user_type_list",
+ > "field": [
+ > {
+ > "name": "country",
+ > "label": {},
+ > "type": { "content": "country_list" }
+ > }
+ > ]
+ > }
+ > ],
+ > "content": [
+ > {
+ > "id": "entity",
+ > "section": [
+ > {
+ > "field": [
+ > {
+ > "name": "user_type",
+ > "label": {},
+ > "type": { "content": "user_type_list" }
+ > }
+ > ]
+ > }
+ > ]
+ > }
+ > ]
+ > }
+ > EOF
+