Add optional regex constraints

This commit is contained in:
2026-06-16 11:27:27 +09:00
parent 84680e2652
commit f1a5836247
9 changed files with 160 additions and 6 deletions
+9
View File
@@ -0,0 +1,9 @@
# Regex example
Regex constraints are optional. Run this example with the `regex` feature enabled:
```sh
cargo run -q -p decodal --features regex -- examples/regex/main.dcdl
```
Without the feature, regex validation returns an unsupported feature diagnostic.
+7
View File
@@ -0,0 +1,7 @@
let
Identifier = String & /^[A-Za-z_][A-Za-z0-9_]*$/;
ApiName = Identifier & /^api_/;
in
{
service = ApiName default "api_gateway";
}