aiohttp-jsonrpc icon indicating copy to clipboard operation
aiohttp-jsonrpc copied to clipboard

Drop py2json

Open kwarunek opened this issue 7 years ago • 1 comments

I use ujson as a dumper/loader due to performance reasons. But for large objects (depth) py2json becomes a bottleneck.

Since functionality of py2json is strictly a dumper thing, what do you say to drop double "encoding" - remove py2json from _parse_json. One could still use it by

JSONRPCView.DUMPS = lambda data: json.dumps(py2json(data))

or even introduce custom dump method in common/utils.

Of course I could override _parse_json but it is consider private and secondly you nicely expose class properties to customize DUMPS and LOADS.

kwarunek avatar Mar 02 '18 10:03 kwarunek

I can provide PR. Currently I'm working on handler to throw errors according to spec.

kwarunek avatar Mar 02 '18 10:03 kwarunek