```
class Solution(object):
def bstToList(self, root):
if not root:
return []
return self.bstToList(root.left) + [root.val] + self.bstToList(root.right)
def getMinimumDifference(self, root):
nodes = self.bstToArray(root)
return min([abs(a-b) for a,b in zip(nodes, nodes[1:])])
```