python-react icon indicating copy to clipboard operation
python-react copied to clipboard

Allow JSON serializer to be overridden

Open markfinger opened this issue 8 years ago • 1 comments

It's probably worth allowing custom json serializers to be easily added.

The change should be pretty simple, see

https://github.com/markfinger/python-react/blob/1bad117ab36ced678b3c99b876b5e3eb7baa0750/react/render_server.py#L27

Basically, RenderServer.render should accept a json_encoder kwarg, that defaults to the current one.

It's also probably worth explicitly exposing the default encoder as a RenderServerEncoder subclass, to make subclassing easier for downstream users.

markfinger avatar Jul 06 '17 00:07 markfinger

See also: #77

markfinger avatar Jul 06 '17 00:07 markfinger