Repository: docarray/docarray

Issue:
Inconsistent `to_json()` return type
### Initial Checks

- [X] I have read and followed [the docs](https://docs.docarray.org/) and still think this is a bug

### Description

`to_json()` returns a `str` for models inherited from `BaseDoc`, whereas it is `bytes` for `DocList`

### Example Code

```Python
from docarray import BaseDoc, DocList


class MyModel(BaseDoc):
    text: str
        
print(type(MyModel(text="abc").to_json())) # <class 'str'>
print(type(DocList[MyModel]([MyModel(text="abc")]).to_json())) # <class 'bytes'>
```


### Docarray Version

```Text
0.37.1
```


### Affected Components

- [ ] [Vector Database / Index](https://docs.docarray.org/user_guide/storing/docindex/)
- [ ] [Representing](https://docs.docarray.org/user_guide/representing/first_step)
- [X] [Sending](https://docs.docarray.org/user_guide/sending/first_step/)
- [ ] [storing](https://docs.docarray.org/user_guide/storing/first_step/)
- [ ] [multi modal data type](https://docs.docarray.org/data_types/first_steps/)


Discussion:
I will take a look

Resolving patch:
diff --git a/docarray/array/doc_list/io.py b/docarray/array/doc_list/io.py
--- a/docarray/array/doc_list/io.py
+++ b/docarray/array/doc_list/io.py
@@ -183,7 +183,7 @@ def _write_bytes(
             elif protocol == 'pickle-array':
                 f.write(pickle.dumps(self))
             elif protocol == 'json-array':
-                f.write(self.to_json())
+                f.write(self.to_json().encode())
             elif protocol in SINGLE_PROTOCOLS:
                 f.write(
                     b''.join(
@@ -327,11 +327,11 @@ def from_json(
         json_docs = orjson.loads(file)
         return cls([cls.doc_type(**v) for v in json_docs])
 
-    def to_json(self) -> bytes:
+    def to_json(self) -> str:
         """Convert the object into JSON bytes. Can be loaded via `.from_json`.
         :return: JSON serialization of `DocList`
         """
-        return orjson_dumps(self)
+        return orjson_dumps(self).decode('UTF-8')
 
     @classmethod
     def from_csv(


Test patch:
diff --git a/tests/units/array/test_array_from_to_json.py b/tests/units/array/test_array_from_to_json.py
--- a/tests/units/array/test_array_from_to_json.py
+++ b/tests/units/array/test_array_from_to_json.py
@@ -78,9 +78,9 @@ def _rand_vec_gen(tensor_type):
         return vec
 
     v = generate_docs(tensor_type)
-    bytes_ = v.to_json()
+    json_str = v.to_json()
 
-    v_after = DocVec[v.doc_type].from_json(bytes_, tensor_type=tensor_type)
+    v_after = DocVec[v.doc_type].from_json(json_str, tensor_type=tensor_type)
 
     assert v_after.tensor_type == v.tensor_type
     assert set(v_after._storage.columns.keys()) == set(v._storage.columns.keys())
@@ -125,9 +125,9 @@ class MyDoc(BaseDoc):
         return vec
 
     v = generate_docs()
-    bytes_ = v.to_json()
+    json_str = v.to_json()
 
-    v_after = DocVec[v.doc_type].from_json(bytes_, tensor_type=TensorFlowTensor)
+    v_after = DocVec[v.doc_type].from_json(json_str, tensor_type=TensorFlowTensor)
 
     assert v_after.tensor_type == v.tensor_type
     assert set(v_after._storage.columns.keys()) == set(v._storage.columns.keys())