Support traversable structure in JSON serializer