Ensure an array field

def _ensure_array(self, key, value):
        """Ensure an array field"""
        if key not in self._json_dict:
            self._json_dict[key] = []

            self._size += 2             # brackets
            self._ensure_field(key)

        if len(self._json_dict[key]) > 0:
            # this array already has an entry, so add comma and space
            self._size += 2

        if isinstance(value, str):
            self._size += 2  # quotes
        self._size += len(str(value))

        self._json_dict[key].append(value)