Skip to content

Commit 751318c

Browse files
Merge pull request #234269 from dciborow/patch-3
Update user-defined-data-types.md
2 parents 8056bad + 3fc26ec commit 751318c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

articles/azure-resource-manager/bicep/user-defined-data-types.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,19 @@ The valid type expressions include:
9191
}
9292
```
9393
94+
Decorators may be used on properties. `*` may be used to make all values require a constrant. Additional properties may still be defined when using `*`. This example creates an object that requires a key of type int named `id`, and that all other entries in the object must be a string value at least 10 characters long.
95+
96+
```bicep
97+
type obj = {
98+
@description('The object ID')
99+
id: int
100+
101+
@description('Additional properties')
102+
@minLength(10)
103+
*: string
104+
}
105+
```
106+
94107
**Recursion**
95108
96109
Object types may use direct or indirect recursion so long as at least leg of the path to the recursion point is optional. For example, the `myObjectType` definition in the following example is valid because the directly recursive `recursiveProp` property is optional:

0 commit comments

Comments
 (0)