diff --git a/CHANGELOG.md b/CHANGELOG.md index 22d938c54..78079a237 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## v1.13.0 (unreleased) +ENHANCEMENTS: +- Support the new bicep types. + ## v1.12.0 ENHANCEMENTS: - `azapi_resource` resource: Support `ignore_body_changes` property. diff --git a/internal/azure/types/array_type.go b/internal/azure/types/array_type.go index 25a1b6d5f..b02075091 100644 --- a/internal/azure/types/array_type.go +++ b/internal/azure/types/array_type.go @@ -12,8 +12,8 @@ var _ TypeBase = &ArrayType{} type ArrayType struct { Type string `json:"$type"` ItemType *TypeReference `json:"itemType"` - MinLength int `json:"minLength"` - MaxLength int `json:"maxLength"` + MinLength *int `json:"minLength"` + MaxLength *int `json:"maxLength"` } func (t *ArrayType) GetWriteOnly(body interface{}) interface{} { @@ -55,11 +55,11 @@ func (t *ArrayType) Validate(body interface{}, path string) []error { } // check the length - if len(bodyArray) < t.MinLength { + if t.MinLength != nil && len(bodyArray) < *t.MinLength { errors = append(errors, utils.ErrorCommon(path, fmt.Sprintf("array length is less than %d", t.MinLength))) } - if len(bodyArray) > t.MaxLength { + if t.MaxLength != nil && len(bodyArray) > *t.MaxLength { errors = append(errors, utils.ErrorCommon(path, fmt.Sprintf("array length is greater than %d", t.MaxLength))) }