Remove deprecated xatrr.TypeWithValidate
interface
#978
Labels
breaking-change
This PR introduces a breaking change or the resolution of this issue may require a breaking change.
Milestone
Changes in #968 included the deprecation of the
xattr.TypeWithValidate
interface. As part of the preparation for the release ofv2.x
of the Framework we should remove thexattr.TypeWithValidate
interface and all usages.A further consideration is the removal of the implementation of
xattr.TypeWithValidate
from the basetypesFloat64Type
,Int64Type
,ListType
,MapType
andSetType
.For
Float64Type
,Int64Type
, it may not be necessary to implement the equivalent validation onFloat64Value
,Int64Value
as the calls to<Float64|Int64>Type.ValueFromTerraform
ensure that thetftypes.Value
supplied can be represented as 64-bit floating point, and integer values, respectively. The constructors on the corresponding value types only accept 64-bit floating point, and integer values too (e.g.,NewFloat64Value
). So it doesn't seem that there is a way to generate aFloat64Value
or anInt64Value
type that would have a value that couldn't be represented as a 64-bit floating point, or integer value, respectively.The base types
ListType
,MapType
andSetType
also implementxatrr.TypeWithValidate
, iterating over their elements and callingValidate()
on each. If it is unnecessary to implement validation onFloat64Value
,Int64Value
value types, for the reasons outlined, then it may not be necessary to implement validation onListValue
,MapValue
andSetValue
types either as the call to<List|Map|Set>Type.ValueFromTerraform
will callValueFromTerraform
on each of the elements.References:
The text was updated successfully, but these errors were encountered: