ijl / orjson

Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy
Apache License 2.0
6.29k stars 215 forks source link

Relaxed JSON deserializing #528

Closed stefanodvx closed 3 weeks ago

stefanodvx commented 4 weeks ago

Is there any way to deserialize a relaxed JSON structure using orjson? Relaxed JSON is something like that {key: "value"}. The difference is that keys are not quoted.

>>> orjson.loads('{key: "value"}')
Traceback (most recent call last):
  ...
orjson.JSONDecodeError: unexpected character: line 1 column 2 (char 1)
0x1618 commented 3 weeks ago

I don't think so. Your example is not valid json so i don't see a reason to support it.

ijl commented 3 weeks ago

This supports RFC 8259.