Skip to content

Commit dd88ba0

Browse files
authored
Documented min_size and max_size (#15811)
1 parent ce790e6 commit dd88ba0

File tree

1 file changed

+30
-1
lines changed

1 file changed

+30
-1
lines changed

docs/content/reference/field.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,36 @@ item_type:
435435
MULTI_LINE_FIELD_DESCRIPTION
436436
```
437437

438+
### `min_size`
439+
Array only. Validates that the array has at least this many items in it.
440+
441+
In many cases, it is better to avoid client-side validation. See [Best practices: Validation]({{< ref "/best-practices/validation" >}}) for more information.
442+
443+
Example:
444+
445+
```yaml
446+
- name: 'fieldOne'
447+
type: Array
448+
item_type:
449+
type: String
450+
min_size: 1
451+
```
452+
453+
### `max_size`
454+
Array only. Validates that the array has at most this many items in it.
455+
456+
In many cases, it is better to avoid client-side validation. See [Best practices: Validation]({{< ref "/best-practices/validation" >}}) for more information.
457+
458+
Example:
459+
460+
```yaml
461+
- name: 'fieldOne'
462+
type: Array
463+
item_type:
464+
type: String
465+
max_size: 10
466+
```
467+
438468
### `item_validation`
439469
Array only. Controls the [`ValidateFunc`](https://developer.hashicorp.com/terraform/plugin/sdkv2/schemas/schema-behaviors#validatefunc)
440470
used to validate individual items in the array. Behaves like [`validation`]({{<ref "#validation" >}}).
@@ -482,7 +512,6 @@ Example: Enum
482512
function: 'customFunction'
483513
```
484514

485-
486515
## `NestedObject` properties
487516

488517
### `properties`

0 commit comments

Comments
 (0)