Add required array element constraints
This commit is contained in:
@@ -31,6 +31,23 @@ disabled_config = NewConfig & {
|
||||
enabled_config = NewConfig;
|
||||
```
|
||||
|
||||
## 配列スキーマ
|
||||
|
||||
```dcdl
|
||||
Services = [...{
|
||||
name = String;
|
||||
port = Int default 8080;
|
||||
}];
|
||||
|
||||
Services & [
|
||||
{ name = "api"; },
|
||||
{ name = "worker"; port = 9000; },
|
||||
]
|
||||
```
|
||||
|
||||
抽象配列には要素制約が必須である。
|
||||
この例では、1 番目の要素の `port` は `8080` に materialize される。
|
||||
|
||||
## 関数と制約
|
||||
|
||||
```dcdl
|
||||
|
||||
Reference in New Issue
Block a user