I come from dotnet - new to python - and I was struggling to find the best way to serialize/deserialize python classes, until I found this library. It should be simple as this library does it, so thank you for that.
Now into my issue, I'm trying to deserialize the following JSON:
UPDATE
Also, I don't know the difference between jsons.load and jsons.loads. So when trying load (singular), I got different error:
raise DeserializationError(message, json_obj, cls) from err
jsons.exceptions.DeserializationError: Could not deserialize value "{"id":"ca9a6637-243f-435f-920f-f163d52cc426","data":{"tab":{"active":true,"audible":false,"autoDiscardable":true,"discarded":false,"favIconUrl":"https://opensource-demo.orangehrmlive.com/web/dist/favicon.ico?v=1689053487449","groupId":-1,"height":911,"highlighted":true,"id":1980784105,"incognito":false,"index":1,"mutedInfo":{"muted":false},"pinned":false,"selected":true,"status":"complete","title":"OrangeHRM","url":"https://opensource-demo.orangehrmlive.com/web/index.php/auth/login","width":1920,"windowId":1980783809}}}" into "server.commands.Response".
string indices must be integers, not 'str'
I come from
dotnet
- new topython
- and I was struggling to find the best way to serialize/deserialize python classes, until I found this library. It should be simple as this library does it, so thank you for that.Now into my issue, I'm trying to deserialize the following JSON:
Into these classes:
The code to deserialize is:
jsons.loads(response, commands.Response[commands.ConnectionResponse])
This gives me an error:
Where does this "origin" coming from?
UPDATE Also, I don't know the difference between
jsons.load
andjsons.loads
. So when tryingload
(singular), I got different error: