File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -850,12 +850,16 @@ func (m schemaMap) internalValidate(topSchemaMap schemaMap, attrsOnly bool) erro
850850 return fmt .Errorf ("%s: ValidateFunc is for validating user input, " +
851851 "there's nothing to validate on computed-only field" , k )
852852 }
853+ if v .ValidateDiagFunc != nil {
854+ return fmt .Errorf ("%s: ValidateDiagFunc is for validating user input, " +
855+ "there's nothing to validate on computed-only field" , k )
856+ }
853857 }
854858
855- if v .ValidateFunc != nil {
859+ if v .ValidateFunc != nil || v . ValidateDiagFunc != nil {
856860 switch v .Type {
857861 case TypeList , TypeSet :
858- return fmt .Errorf ("%s: ValidateFunc is not yet supported on lists or sets." , k )
862+ return fmt .Errorf ("%s: ValidateFunc and ValidateDiagFunc are not yet supported on lists or sets." , k )
859863 }
860864 }
861865
@@ -868,6 +872,12 @@ func (m schemaMap) internalValidate(topSchemaMap schemaMap, attrsOnly bool) erro
868872 return fmt .Errorf ("%s: Field name may only contain lowercase alphanumeric characters & underscores." , k )
869873 }
870874 }
875+
876+ // Warn of deprecations
877+ if v .ValidateFunc != nil && v .ValidateDiagFunc == nil {
878+ log .Printf ("[WARN] ValidateFunc is deprecated, please use ValidateDiagFunc" )
879+ }
880+
871881 }
872882
873883 return nil
You can’t perform that action at this time.
0 commit comments