Add JSON encoding of Assignment instances.