Skip to content

Commit 0bd2ae9

Browse files
committed
move test helper to test file
remove JoinPath helper
1 parent 692d3b9 commit 0bd2ae9

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

diag/path.go

Lines changed: 0 additions & 16 deletions
This file was deleted.
File renamed without changes.

helper/schema/schema.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -431,7 +431,9 @@ func (s *Schema) validateFunc(decoded interface{}, k string, path cty.Path) diag
431431
if s.ValidateDiagFunc != nil {
432432
diags = s.ValidateDiagFunc(decoded, path)
433433
for i := range diags {
434-
diags[i].AttributePath = diag.JoinPath(path, diags[i].AttributePath)
434+
if !diags[i].AttributePath.HasPrefix(path) {
435+
diags[i].AttributePath = append(path, diags[i].AttributePath...)
436+
}
435437
}
436438
} else if s.ValidateFunc != nil {
437439
ws, es := s.ValidateFunc(decoded, k)

0 commit comments

Comments
 (0)