Just inorder travel the tree.

Note: There are at least two nodes in this BST.

```
def getMinimumDifference(self, root):
def dfs(node, l=[]):
if node.left: dfs(node.left, l)
l.append(node.val)
if node.right: dfs(node.right, l)
return l
l = dfs(root)
return min([abs(a-b) for a,b in zip(l, l[1:])])
```

If it's not a BST, just apply `l = sorted(bfs(root))`