This is a request for an enhancement to support JSON serialization for the different types supported
Eg:
import json
from pocketbase import PocketBase
client = PocketBase('http://127.0.0.1:8090')
# authenticate as regular user
user_data = client.collection("users").auth_with_password("foo@bar.com", "thisIsAFaksePassword123")
# get a compliance report
report = client.collection("compliance").get_list()
print(json.dumps(report, indent=4))
This currently results in:
Traceback (most recent call last):
File "/Users/dansikes/go/src/github.com/dsikes/equip/scripts/test.py", line 12, in <module>
print(json.dumps(report, indent=4))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/__init__.py", line 238, in dumps
**kw).encode(obj)
^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 202, in encode
chunks = list(chunks)
^^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 439, in _iterencode
o = _default(o)
^^^^^^^^^^^
File "/opt/homebrew/Cellar/python@3.11/3.11.2_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/json/encoder.py", line 180, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type ListResult is not JSON serializable
Happy to work on a PR, but wanted to see if this was something you'd consider before doing so.
Great work on this SDK.
This is a request for an enhancement to support JSON serialization for the different types supported
Eg:
This currently results in:
Happy to work on a PR, but wanted to see if this was something you'd consider before doing so.
Thanks!